Limiting the Data by Last/Present Quarterof Year

  • Thread starter Thread starter LA Lawyer
  • Start date Start date
L

LA Lawyer

I want to limit the data on a form or report to only the last quarter or the
present quarter of the year. Is there a way to do this?
 
I want to limit the data on a form or report to only the last quarter
Try this --
SELECT [YourTable].*
FROM [YourTable]
WHERE ([WorkDate] <=
DateAdd("q",Format(Date(),"q")-1,DateSerial(Year(Date()),1,1))-1) And
([WorkDate]
 
I want to limit the data on a form or report to only the last quarter or the
present quarter of the year. Is there a way to do this?

By "last quarter" do you mean October-December of the current year, or the
most recent quarter of the current year?

For the former, a date criterion of
= DateSerial(Year(Date()), 10, 1) AND < DateSerial(Year(Date()) + 1, 1, 1)

For the current quarter,
=dateserial(year(date()),((month(date())-1)\3)*3+1,1) AND < dateserial(year(date()),((month(date())-1)\3)*3+4,1)

For the previous quarter,
 
LA said:
I want to limit the data on a form or report to only the last quarter
or the present quarter of the year. Is there a way to do this?

Create a calculated field and format it to quarter.
You can create another one and format it for the year.
Then it's just a query with Date() formatted for the same things.

Now it's your turn. Free legal advice.
If I sue myself, do I need two attorney's?
 
Back
Top