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

trending report

Status
Not open for further replies.

ltran4

Programmer
Jan 23, 2006
1
CA
Hi,

I have to create a trending report for the past 3 and 13 months. Does anybody know how to code the starting date to start the trend? Any piece of advice would help.
Thanks,
 
You can step back a number of months using DateAdd("m", -3, currentdate) and DateAdd("m", -13, currentdate). Or get whole months using Month(DateAdd("m", -3, currentdate)) and the same for your dates.

I'm not precisely sure what a 'trending report' is. But Crystal is great at turning grouped data into fancy graphs.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
hi

i think your report is rather similar in nature to what i'm doing now

Mine is abt retrieving history for the past 6 months and past 1 year to determine the avg unit price for a part.

what i did was define a period parameter of numVar

After which i created a custom function called PastXMonths to determine the date range

Function (numberVar period)

Local dateVar Range dr;

select period
Case 6:
dr:=Date(DateAdd("m",-6,Date(Year(CurrentDate),Month(CurrentDate),1))) To CurrentDate
Case 12:
dr:=Date(DateAdd("m",-12,Date(Year(CurrentDate),Month(CurrentDate),1))) To CurrentDate
default:
dr:=Date(2004,01,01) To CurrentDate

And another parameter minDate to find the lower bound of the range...

well there might be more simpler way which i could not think of currently =b

hope this help. Gd luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top