DATEDIFF ( datepart , startdate , enddate )

Return Type int

 

datepart

Abbreviations

year

yy, yyyy

quarter

qq, q

month

mm, m

dayofyear

dy, y

day

dd, d

week

wk, ww

hour

hh

minute

mi, n

second

ss, s

millisecond

ms

microsecond

mcs

nanosecond

ns

 

http://msdn.microsoft.com/en-us/library/ms189794.aspx

 

DATEDIFF (Transact-SQL) - SQL Server

DATEDIFF (Transact-SQL) In this article --> APPLIES TO: SQL Server Azure SQL Database Azure SQL Data Warehouse Parallel Data Warehouse This function returns the count (as a signed integer value) of the specified datepart boundaries crossed between the spec

docs.microsoft.com

 

반응형

'Database > MSsql' 카테고리의 다른 글

[MSSQL] AUTOINCREMENT 설정하기  (739) 2013.10.17
MS-SQL DATETIME CONVERT  (59) 2013.08.29
MSSQL AUTO INCREMENT INIT  (57) 2013.07.04
[MSSQL] Database 복원  (0) 2013.05.07

+ Recent posts