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.
Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.