More than one calculation with between dates

  • Thread starter Carrie_Loos via AccessMonster.com
  • Start date
C

Carrie_Loos via AccessMonster.com

I have the following query:

SELECT MROs.[Core Part Nbr], Format([Date Open],"mmm-yy") AS [Month], Sum
(MROs.[Ord Qty]) AS Forecast1
FROM MROs
WHERE (((MROs.[Date Open]) Between DateAdd("m",-12,Date()) And DateAdd("m",0,
Date())))
GROUP BY MROs.[Core Part Nbr], Format([Date Open],"mmm-yy");

But what I need to do is create a forecast for several months where the
DateAdd will numbered months will change. Also, I was hoping to do an average
of the from the months included. Something like.....{i.e. Count(Between
DateAdd("m",-12,Date()) And DateAdd("m",0,Date()))))} then use that as a
divisor? How do you do that?
 
D

Dale Fye

My first question is what is with this Dateadd("m", 0, Date())? This
expression returns the same value as Date(), which is a whole lot easier to
read.

I don't really understand anyting after that. Can you give us an example of
what you want your output to look like?

Dale
 
C

Carrie_Loos via AccessMonster.com

Well, I am sure that I am just confused.

Dale said:
My first question is what is with this Dateadd("m", 0, Date())? This
expression returns the same value as Date(), which is a whole lot easier to
read.

I don't really understand anyting after that. Can you give us an example of
what you want your output to look like?

Dale
I have the following query:
[quoted text clipped - 10 lines]
DateAdd("m",-12,Date()) And DateAdd("m",0,Date()))))} then use that as a
divisor? How do you do that?
 

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

Top