Previous Months data

  • Thread starter gm6243 via AccessMonster.com
  • Start date
G

gm6243 via AccessMonster.com

Hi,

I am using Access 2003 as Front end and Sql backend. I have a cross tab query
which spits sales by sales rep for month 1 to mth xx based on the date
selected in cmbox enddate. I want to restrict the data for for the past 6
mths from the date selected in the combobox enddate.

I tried using this :
Between DateAdd("m",-5,[Forms]![Utilization Reports]![EndDate]) And DateAdd
("m",0,[Forms]![Utilization Reports]![EndDate])

but for the months with 30 days, it starts the report from the 30th of the
month.

To make it clear, when I select June 30, 2009, it should give me the totals
for Jan 2009, Feb 2009 .....June 2009.

Can someone please advise at to what I am doing wrong here.

Thank you,

Gmen
 
J

Jerry Whittle

Between DateAdd("m",-5,[Forms]![Utilization
Reports]![EndDate])-Day([Forms]![Utilization Reports]![EndDate])+1 AND
DateAdd("m",1,[Forms]![Utilization
Reports]![EndDate])-Day([Forms]![Utilization Reports]![EndDate])

Make sure that you want -5 or -6.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Date calculations 11
Append Query 6
Pivot table 0
Cross Tab Query 4
Querie that leads to trend chart 2
PIVOT Question 9
Total by certain time period 1
Running Total 2

Top