You are on page 1of 1

Hm date - Hm ngy thng : Dng thao tc v?i cc gi tr? ngy thng. Ch? vi?t t?t v gi tr?

: Hour = hh ( 0 - 23 ) , Minute = Mi ( 0 - 59 ) , Second = Ss ( 0 - 59 ), Millisec ond = Ms ( 0 - 999 ) , Day of year = Dy ( 1 - 366 ) , Day = Dd ( 1 - 31) , Year = yy ( 1753 - 9999 ). getdate : Ngy hi?n t?i. V d? : Code:select getdate() dateadd ( datepart , number , date ) : Gi tr? ngy c?ng v?i m?t s?. V d? : Code:select dateadd ( mm, 4 , ' 01/01/99 ' ) Thm vo tru?ng mm (thng) v?i gi tr? 4 . K?t qu? s? l : 05/01/99 datediff (datepart , date 1 ,date 2) : Gi tr? chnh l?ch gi?a hai ngy . V d? : Code:select datediff ( mm , ' 01/01/99 ' , ' 05/01/99 ' ) Tr? v? k?t qu? l : 4 . So snh gi?a hai tru?ng thng . datename (datepart , date ) : Gi tr? ngy d?nh d?ng tuong ?ng . V d? : Code:select datename (dw , ' 01/01/2000 ' ) K?t qu? s? tr? v? Saturday. datepart ( datepart , date ) V d? : Code:select datepart ( day , ' 01/15/2000 ' ) Tr? v? k?t qu? gi tr? ngy l 15.

You might also like