Link to home
Start Free TrialLog in
Avatar of TheAnvilGroup
TheAnvilGroupFlag for United Kingdom of Great Britain and Northern Ireland

asked on

T-SQL, Select a date range from now and 6 months in past.

Hi Guys.

I need to find a way in t-sql to select a date range from now to 6 months in the past.

We have a field name called DatePublished that holds the date the item was added to the database.

So the results that would come back would be 6 months worth of stories.

Cheers!
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
note: getdate() is now, date + time.
if you need full day, resp full month, you will need to add some more to get the "corrected" date value...