question

boroyj avatar image
boroyj asked

rolling dates at month end

Hi all, I have a query that pulls items recieved in a month for the 1st of up to the LWD using the following: SELECT @start_date = DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0) SELECT @end_date = dbo.fnc_get_parameter_value('yesterday'); I'm having difficulty at the start of a new month - the report needs to capture the whole month when the date rolls over the above dates change to the 1st of the current month. Could someone recommend a fix please? Thanks in advance.
datedates
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.