Archive for January 29th, 2008
Wes Welker Got Milk Part 2
Posted by Terry Apodaca in Football, Red Raiders, Sports, Texas Tech on January 29, 2008
SQL: First and Last Day of Year
Posted by Terry Apodaca in Code, SQL on January 29, 2008
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

