Return to Snippet

Revision: 60889
at November 16, 2012 02:24 by snoopmole


Initial Code
declare @prevmonth datetime
declare @numprevious int
set @numprevious = 2
set @prevmonth = DATEADD(month, DATEDIFF(month,0,getdate())-@numprevious,0)

Initial URL

                                

Initial Description
One line to determine start of previous month

Initial Title
Get first day of month using datediff

Initial Tags
sql

Initial Language
SQL