Archive for January 29th, 2008

Wes Welker Got Milk Part 2

Here’s a follow up to a previous post:

Wes Welker Got Milk 2

No Comments

SQL: First and Last Day of Year

These lines of code will get you the First and Last day of the current year.

SQL:

SELECT DATEADD(yy, DATEDIFF(yy,0,getdate()), 0),'First Day of the Year'
UNION
SELECT DATEADD(dd,-1,DATEADD(yy,0,DATEADD(yy,DATEDIFF(yy,0,getdate())+1,0))),'Last Day of the Year'

Results:
2008-01-01 00:00:00.000 First Day of the Year
2008-12-31 00:00:00.000 Last Day of the Year

13 Comments