Batch22 SQLServerScript16
Batch22 SQLServerScript16
EOMONTH: It will display last date of that particular month use EOMONTH
Syntax: EOMONTH(ExistingDateColumn, no of months)
*/
select * from FirstTable1
/*
2) Using Format function we can display different date formates
Syntax: FORMAT(ExistingDateColumn,Dateformat)
*/
select * from FirstTable1
/*
3) Using Format function we can add currency symbol of numeric columns
Syntax: FORMAT(NumericColumn,'CurrencySymbol#.#')
*/
Select * from FirstTable1
/*
CONERT or CAST: Converting from 1 datatype to another datatype
Convert Syntax:CONVERT(Newdatatype,existingcolumnname)
Cast Syntax: CAST(Existingcolumnname as Newdatatype)
*/
select * from FirstTable1
/*
String Functions are
CONCAT,LOWER,UPPER,PATINDEX,CHARINDEX,LEFT,RIGHT,LEN,STUFF,TRIM,REPLACE,SUBSTRING
/*
LOWER: Convert into small letters use LOWER
Syntax: LOWER(Charactercolumn)
*/
Select * from FirstTable1
/*
LEFT: It will extract the characters from left side use LEFT function
Syntax: LEFT(Existingcolumnname,No of Characters)
*/
select * from FirstTable1
/*
RIGHT: It will extract the characters from right side use RIGHT function
Syntax: RIGHT(Existingcolumnname,No of Characters)
*/
select * from FirstTable1
/*
LEN: It will calculate total no of characters in each and every cell
Syntax: LEN(ExistingColumnname)
*/
select * from FirstTable1