Year to Date and Previous Months

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Right now, I've got a query that can pull up all data for a given year, and
another that will specify it further to a month and year.

I need to make a report that has values from a previous month in addition to
the current month. How can I get it to generate values like this?

For example:

Previous Month:
Current Month:
Year to Date:

I can easily get it to generate the value for the current month, yet I do
not know how to go about getting it to generate the values for the other two
fields.

Thanks in advance.
 
Right now, I've got a query that can pull up all data for a given year, and
another that will specify it further to a month and year.

I need to make a report that has values from a previous month in addition to
the current month. How can I get it to generate values like this?

For example:

Previous Month:
Current Month:
Year to Date:

I can easily get it to generate the value for the current month, yet I do
not know how to go about getting it to generate the values for the other two
fields.

Thanks in advance.

"From a previous month" or "from the previous month". They are
different.

From the Previous month
Where [DateField] Between DateSerial(Year(Date()),Month(Date())-1,1)
and Date()

From a Previous Month (how do we know which previous month?):
Where [DateField] Between DateSerial(Year(Date()),[Enter the month
number],1) and Date()

Current month
where Format([DateField],"mm yyyy") = format(Date(),"mm yyyy")

Year to Date:
Where Year([DateField]) = Year(Date())
 
Back
Top