|
Posted by Roy Harvey on 01/18/07 00:08
WHERE create_date < DATEADD(month,DATEDIFF(month, 0,getdate()),0)
AND create_date >= DATEADD(month,DATEDIFF(month, 0,getdate())-1,0)
Roy Harvey
Beacon Falls, CT
On 17 Jan 2007 14:30:29 -0800, "tolcis" <nytollydba@gmail.com> wrote:
>Hi!
>
>I have a query that has to return bunch of data based on the calendar
>month. I have to make sure that it will return data to me for 28 days
>if it is February and for 31 if it is August(for example). I need to
>be able to execute it every first of every month for the past 30, 31 or
>28 days based on the calendar month. Is there a function or a stored
>procedure that I can use to do that?
>
>Thank you,
>T.
Navigation:
[Reply to this message]
|