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.

Updating numbers with 'Replace Field Contents with Calculation'?

Featured Replies

Hi all,

Our student database has 7 digit student numbers. The first two digits represent the year

eg.

In the number 9876555, 98 represents the year 1998.

In the number 0129292, 01 represents the year 2001.

Now I need to include the 19 or 20 (ie the full year) to these existing numbers so that:

9876555 becomes 199876555

0129292 becomes 200129292

How do I do this?

Use this calc into the replace field contents:

Let(

firstDigit = Left ( student number ; 1 )

Case(

firstDigit ; 19 & student number ;

20 & student number

)

)

Note: do this on a backup copy of the DB because that operation isn't UNDOABLE

  • Author

Thanks Daniele,

But this doesn't work:

an operator is required where you have "Case". In addition, what is firstDigit? Is this supposed to be a field? Filemaker is asking for a field.

Sorry I'm not good at functions/calculations so I don't understand this.

Could you explain further and more simply?

Use this calc into the replace field contents:

Let(

firstDigit = Left ( student number ; 1 )

Case(

firstDigit ; 19 & student number ;

20 & student number

)

)

Note: do this on a backup copy of the DB because that operation isn't UNDOABLE

Pardon, I forgot a ";"

Let(

firstDigit = Left ( student number ; 1 )[color:orange];

Case(

firstDigit ; 19 & student number ;

20 & student number

)

)

  • Author

Great work Daniele!!

Works perfectly.

Thanks very much..and thanks also for the quick replies.

cheers.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.