Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Data in the Last 4 Quarters 1

Status
Not open for further replies.

ESPMH

Technical User
Feb 9, 2010
4
US
I am trying to wrire a formula so only dates of service from the last four quarters are pulled.

I have tried this formula, but it pulls dates that are included in the current quarter as well as the past 4 quarters.

{Incident_Date} in dateserial(year(DateAdd ("q", -4, currentdate)), (datepart("q",DateAdd ("q", -4, currentdate))*3)-2,1) to
currentdate - day(currentdate)

Here are a few example of what I need the report to do

Example 1:
Date Report was ran: 2/10/2010

Dates that should be included in the report:
1Q2009-4Q2010


Example 2:

Date Report was ran: 10/20/2010

Dates that should be included in the report:
4Q2009-3Q2010


 
{Incident_Date} in dateserial(year(DateAdd ("q", -4, currentdate)), (datepart("q",DateAdd ("q", -4, currentdate))*3)-2,1) to
dateserial(year(currentdate),(datepart("q",currentdate)*3)-2,1)-1

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top