Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

date calculation troubles

Featured Replies

i have created the following calculation -departure date = (Date ( departure month ; departure day ; departure year ))

however, what i get in return is always '12' for the month; the correct day; but always 1 year less than the entered year.

now, my months are entered as text, and so i know i need to do something radically different here, but do not know how to proceed (for other reasons, auto emails, etc, i need the month as text) -- i need help with this.

and then the year problem, just baffles me. for instance i enter 2008 in the year field, whch returns 12/01/2009 in the departure date field.

any help would be great!

The Date() function expects a number for the month. When there's no number, the text evaluates as 0, which is the December of previous year.

It's preferable to enter the month as a number - or, even better, enter the date as date. It is both easier and less error-prone to translate a date to text format (e.g. using the MonthName function) then the other way around.

Hi

there is something that isn't correct here...

You said: "but always 1 year less than the entered year" and after a while you said:

"for instance i enter 2008 in the year field, whch returns 12/01/2009 "

BTW FM7 is smart enought to calc the correct date, even if you set the calc as text result !

So, please, give us more informations about those fields (departure month ; departure day ; departure year )

Perhaps your "Departure month" contains the monthName ?

If your "departure month" contains the name of the month, you can try this calc to get the number of the month:

Case(

MonthName ( Date ( 1 ; 1 ; 1 ) ) = departure month ; 1 ;

MonthName ( Date ( 2 ; 1 ; 1 ) ) = departure month ; 2 ;

MonthName ( Date ( 3 ; 1 ; 1 ) ) = departure month ; 3 ;

MonthName ( Date ( 4 ; 1 ; 1 ) ) = departure month ; 4 ;

MonthName ( Date ( 5 ; 1 ; 1 ) ) = departure month ; 5 ;

MonthName ( Date ( 6 ; 1 ; 1 ) ) = departure month ; 6 ;

MonthName ( Date ( 7 ; 1 ; 1 ) ) = departure month ; 7 ;

MonthName ( Date ( 8 ; 1 ; 1 ) ) = departure month ; 8 ;

MonthName ( Date ( 9 ; 1 ; 1 ) ) = departure month ; 9 ;

MonthName ( Date ( 10 ; 1 ; 1 ) ) = departure month ; 10 ;

MonthName ( Date ( 11 ; 1 ; 1 ) ) = departure month ; 11 ;

MonthName ( Date ( 12 ; 1 ; 1 ) ) = departure month ; 12 ;

"?"

)

  • Author

thank you raybaudi.

i did not get the last calculation to work but changed over to a full numeric system at your suggestion and things seem to be working now.

again thank you so much for your attention.

best arfus nyc

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.