Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6580 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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!

Posted

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.

Posted

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.

Posted (edited)

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 by Guest

This topic is 6580 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.