January 17, 200718 yr Why would this calc not return "the first day of the month that occurred 11 months ago"... Date(Month(CurrentDate)-11;1;Year(CurrentDate-32)) ...and return "2/1/2005" instead? My first guess was that subtracting 32 days from the current date in the "Year" section of the date would allow for an accurate "last year". Was hoping to be able to "slide" dates on an existing report to account for the change of year... *CurrentDate is a global date field set with Get(CurrentDate) upon opening. Thx!
January 17, 200718 yr This seems to work: Date((Month(Get(CurrentDate))+1); 1;((Year(Get(CurrentDate))-1)))
January 17, 200718 yr Author Sorry, all - my description was lacking. I set up a calendar-year sales chart and have now been asked to make it "sliding", or a dynamic 12-month snapshot. So instead of ReportMonth1Start = "January this yr", it'd be ReportMonth1Start = "first day of month 11 mos ago, dynamically calc the yr".... I dove into the whole -32 days thing to accommodate Jan07, and in the hopes of not having to use a big Case statement.
January 17, 200718 yr Piggybacking on Comment's post, in your report generating script, just have something like this. Enter Find Mode [] Insert Calculated Result [ SalesTable:SalesDate; Date ( Month ( gCurrentDate ) - 11 ; 1 ; Year ( gCurrentDate ) ) & ".." & gCurrentDate ] Perform Find [] I renamed your CurrentDate field to gCurrentDate to avoid confusion on the forum.
January 18, 200718 yr Author Well eureka - I didn't realize that the month() parameter would interpret the proper year... Thought the month/day/year parameters were all isolated... Thanks to you all for the illumination. Edited January 18, 200718 yr by Guest
Create an account or sign in to comment