Cole100
asked on
Need SQL code to query month to date last year
I am trying to build a query in Access 2010 to pull data from month to date last year.
Example. today being 10/29/14, I am using Between DateAdd("d",-DatePart("d", Date())+1, Date()) And Date()-1 which pulls my data for 10/1/2014 to 10/28/2014
I am trying to look a comparable sales data so I need a piece of code that pulls 10/1/2013 to 10/28/2013
Example. today being 10/29/14, I am using Between DateAdd("d",-DatePart("d",
I am trying to look a comparable sales data so I need a piece of code that pulls 10/1/2013 to 10/28/2013
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Both etsherman and gustav solution did exactly as i needed. thank you
dateadd("y",-1,DateAdd("d"