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

past date not get info

Status
Not open for further replies.

pcdork

Technical User
May 10, 2005
7
US
I am creating a report using seagate 7.5

I want to get the 'count' number from a field, using the running total i have selected the field that i want and in the evaluate i have created the following formula

month({ManagementReportData;1.PoolArrivalDate}) = (month(CurrentDate)-4) and
year({ManagementReportData;1.PoolArrivalDate}) = year(currentdate) or
month({ManagementReportData;1.PoolArrivalDate}) = (month(CurrentDate)-5) and
year({ManagementReportData;1.PoolArrivalDate}) = year(currentdate) or
month({ManagementReportData;1.PoolArrivalDate}) = (month(CurrentDate)-6) and
year({ManagementReportData;1.PoolArrivalDate}) = year(currentdate)


this works except that it pulls from the current year and does not pull the info from Nov and Dec of 2004 so I

then came up with this formula

if day(DATE(YEAR(CurrentDate),MONTH(CurrentDate)-6,-1)-1) < year(currentdate) then
DAY(DATE((YEAR(CurrentDate)-1),MONTH(CurrentDate)-6,1)-1)
else
DAY(DATE((YEAR(CurrentDate)),MONTH(CurrentDate)-6,1)-1)

but now i get the error "a month number must be between 1 and 12"
what I am looking to do here is get the info from the last 3-6 months from the current month

thanks for any help
 
These days people use dateserial in lieu of the date function for that reason.

If cr 7.5 supports it, it's much simpler.

The date function does NOT subtract 6 months from a date, so if it's month 3, and you subtract 6, you'll get -3 and Crystal will bomb, so it dateserial doesn't work, code accordingly.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top