Aaryan
SSC Rookie
Points: 47
More actions
July 10, 2016 at 4:21 pm
#311579
My query needs to return the 1st of the current month and Also, it is compared with a date, so it needs to be cast into date format.
HappyGeek
SSCoach
Points: 18729
July 10, 2016 at 9:25 pm
#1889340
Assuming you are referring to a Query that produces data within an SSIS package and you are using SQL 2012 or above, try the following:
SELECT DATEADD(DAY, 1, EOMONTH(getdate(), -1))
...
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply