Select Day (createtime) from Life_unite_product--the days value of the Take time field
Select Month (createtime) from Life_unite_product--take the month value of the Time field
Select year (createtime) from Life_unite_product--the yearly value of the Fetch time field
Select DATEPART (yy,createtime) from Life_unite_product--take the year value of the Time field
Select DATEPART (qq,createtime) from Life_unite_product--take the quarter value of the Time field
Select DATEPART (mm,createtime) from Life_unite_product--take the month value of the Time field
Select DATEPART (dy,createtime) from Life_unite_product--Take time field is the day ordinal of that year
Select DATEPART (dd,createtime) from Life_unite_product--the day value of the Fetch time field
Select DATEPART (wk,createtime) from Life_unite_product--Take the Time field is the first week of that year
Select DATEPART (dw,createtime) from Life_unite_product--Take the Time field is the first weekday of the Week of that year (working days are calculated from Sunday)
Select DATEPART (hh,createtime) from Life_unite_product--the time-out value of the Fetch field
Select DATEPART (mi,createtime) from Life_unite_product--Take the minute value of the Time field
Select DATEPART (ss,createtime) from Life_unite_product--takes the seconds value of the Time field
Select DATEPART (ms,createtime) from Life_unite_product--take the millisecond value of the Time field
Select DATEADD (yy,-1,createtime) from life_unite_product----fetch Time field (year is reduced by 1)
Select DATEADD (mm,3,createtime) from life_unite_product----fetch Time field (month is added 3)
Select DATEADD (dd,1,createtime) from life_unite_product----fetch time field (Day added 1)
Select DATEDIFF (Yy,createtime,getdate ()) from life_unite_product--year difference from current date
Select DATEDIFF (Mm,createtime,getdate ()) from Life_unite_product--The month difference from the current date
Select DATEDIFF (Dd,createtime,getdate ()) from Life_unite_product--the difference in the number of days from the current date
Select DATEDIFF (Mi,createtime,getdate ()) from Life_unite_product--the difference in minutes from the current date
Select Datename (yy,createtime) from Life_unite_product--take the year value of the Time field
Select Datename (mm,createtime) from Life_unite_product--take the month value of the Time field
Select Datename (dd,createtime) from Life_unite_product--the day value of the Fetch time field
Select GETDATE ()--Take the current time
Source: >
From for notes (Wiz)
SQL Scalar function-----Date function day (), month (), year ()