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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Last 6 Months taking into account bridging years 1

Status
Not open for further replies.

Deano1976

Technical User
Dec 16, 2004
41
GB
I am using CR V8.5.

I currently have a crude formula that simply shows me data for the last 6 full months. This formula is below.

Code:
Month({Support_Incident.Date Recorded})>Month(Today())-7 and
Month({Support_Incident.Date Recorded})<=Month(Today())-1

My problem now is that we are in a new year and the formula does not work. I pressume this is because the formula is trying to subtract 7 from month 1 and does not understand that it must go to month 12 when going back from month 1.

Can you offer a solution to this please.
 
Use this instead:
Code:
{Support_Incident.Date Recorded} in dateadd("m",-6,minimum(lastfullmonth)) to maximum(lastfullmonth)

It will give you what you want and it will get passed down to the database in the WHERE clause. In your original formula, the month function on the database field would prevent it from getting passed down.

~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top