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.

Featured Replies

I have put the following into a calculation:

Year ( Get ( CurrentDate ) ) & Case ( Length ( Month ( Get ( CurrentDate ) ) = 1 ) ; "0") & Month ( Get ( CurrentDate ) ) & Case ( Length ( Day ( Get ( CurrentDate ) ) = 1 ) ; "0") & Day ( Get ( CurrentDate ) )

Since today's date is 4/29/04, I'd expect the result to be 20040429. FileMaker returns: 200404029. I have checked that the result of "Length ( Day ( Get ( CurrentDate ) )" is 2, NOT 1.

What am I doing wrong?

I am running FileMaker 7.0v1a on a dual gigahertz Macintosh G4 running OS 10.3.3.

Thank you for your help.

That does seem odd. I'd make it easier, though, and just remove the Cases altogether.

Year ( Get ( CurrentDate ) ) & Right( "00" & Month ( Get ( CurrentDate ) ); 2 ) & Right( "00" & Day ( Get ( CurrentDate ) ); 2 )

  • Author

Thanks Queue! That works great. I appreciate your help. :-)

Though Queue has the best solution, i was intrigued... the problem lies, as you may imagine, in the element:

Case ( Length ( Day ( Get ( CurrentDate ) ) = 1 ) ; "0")

Follow the substitutions, watching the parentheses carefully:

Case ( Length ( Day ( Get ( CurrentDate ) ) = 1 ) ; "0")

Case ( Length ( Day ( <4/29/2004> ) = 1 ) ; "0")

Case ( Length ( 29 = 1 ) ; "0")

Case ( Length ( 0 ) ; "0")

/* 29=1 is a false statement and therefore equal to

FALSE, that is, the number 0 */

Case ( 1 ; "0")

/* The length of the string '0' is 1 */

0

/* 1 is a boolean TRUE, thus the case statement

returns a positive and gives you your

(undesired) result of 0*/

A better calculation would be:

Case ( ( Length ( Day ( Get ( CurrentDate ) ) ) = 1 ) ; "0")

Jerry

Good call. You can remove the extra parens, too.

Case ( Length ( Day ( Get ( CurrentDate ) ) ) = 1 ; "0")

We only needed to move the parens following the '1' before the '='.

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.