4 Replies Latest reply on Oct 3, 2011 10:18 AM by UnionGuy

    Show one month before current month

    UnionGuy

      Title

      Show one month before current month

      Post

      I am looking for a simple way to show one month before the current month; this is for an invoice where payment is for the previous month. For example, I want to show today's invoice (created on October 3, 2011) to show the billing period as September, 2011. I can't get the Date functions or Date fields or Data Formatting to make it work. The best solutions would be to get the // to do it in a text field (which I have now creating the current month and year), but a simple field would work, too. Thanks for the help.

        • 1. Re: Show one month before current month
          philmodjunk

          A calculation can take a date and return a date from the previous month. Data formatting on this calculation field can then show just the month name and year without the day.

          Let ( D = DateField ; D - day ( D ) )

          will return the last day of the previous month. Since you want to hide the day, this will be sufficient. If you use Get ( CurrentDate ) instead of DateField, be sure to make your calculation an unstored calculation or it will not correctly update with each new day's date.

          • 2. Re: Show one month before current month
            UnionGuy

            Good suggestions, PhilModJunk. I found a suggestion in the help files, too, and this calculation works, too: Date(Month(Date Current) -1;Day(Date Current);Year(Date Current)), where Date Current is its own field. I tried using CurrentDate but could not get it to work right, but that would be better to just have one less field to have to deal with. Thanks for the help.

            • 3. Re: Show one month before current month
              philmodjunk

              CurrentDate isn't a field, it's a parameter you pass to the get function that tells FilMaker to pull the current date from your computer's system clock. You can use get ( CurrentDate) in a field's calculation like this, but it won't update automatically when the date changes unless you also specify in storage options that the field be "unstored".

              • 4. Re: Show one month before current month
                UnionGuy

                Got it! Your help was invaluable. This is the field calculation that does what I need: Date(Month(Get(CurrentDate)) -1;Day(Get(CurrentDate));Year(Get(CurrentDate))). Thanks for all the help.