techie troubleshooting blog
Monday, 19 September 2011
Calculate days since begninning of the Year (T-SQL)
print
datediff
(
d
,
'2011-01-01'
,
getdate
())
Or get the difference between any two dates; format is datediff(d, ealier date, later date)
e.g
.
print
datediff
(
d
,
'1969-07-20'
,
'2011-09-19'
)
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment