Link to home
Start Free TrialLog in
Avatar of Mark Wilson
Mark Wilson

asked on

Date Query - Last Full Year

I am using the following query to bring back data from the start of the year to the end of the last month.

The date is datetime field

where  year(acd.startdatetime) = year(getdate()) and  month(acd.startdatetime) <= Month(getdate()) - 1

I now need to a query to bring back the last full years data i.e. 2006 Jan 1st - Dec 31. This will then be run on the 1st of January every year to bring back the previous years data.

Can anybody help?
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