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

Updating numbers with 'Replace Field Contents with Calculation'?


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

Recommended Posts

Posted

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?

Posted

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

Posted

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

Posted

Pardon, I forgot a ";"

Let(

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

Case(

firstDigit ; 19 & student number ;

20 & student number

)

)

This topic is 5905 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.