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.

Determine highest serial number

Featured Replies

What is the easiest way to compute the highest serial number in a column, in FM10?

The serial numbers are of the form P-000002 - that is, fixed-width integer with alpha prefix (thus unusable by the max() function).

If sort / goto record is the only way, so be it - just thought there might be a better way.

Thanks,

Chap

Without going into detail you could strip out the "P-" and use the remainder in the MAX function.

...thus unusable by the max() function).

Hi

what about using the Min ( ) function ?

Try this calculation:

"P-" & Right ( "000000" & Abs ( Min ( YourSerial ) ) ; 6 )

Note that this will work ONLY if your serial is always in the format: P-nnnnnn

 Min ( YourSerial )

I don't think that's a valid expression (unless YourSerial is a repeating field).

My impression is that OP wants the highest serial number in a found set, and cannot use a summary field for this. We need to know if the prefix character is always a single "P".

I don't think that's a valid expression (unless YourSerial is a repeating field).

My impression is that OP wants the highest serial number in a found set, and cannot use a summary field for this. We need to know if the prefix character is always a single "P".

YourSerial was an abbreviation for a self-related field, commonly used for the Summary functions, but you are right... it is better to specify:

"P-" & Right ( "000000" & Abs ( Min ( CartesianSelfJoin::YourSerial ) ) ; 6 )

He said that cannot use the Max( ) function, so I think that he needs the max from all the records.

Well. if you have a x self-join, you could sort it by the serial, descending. Then

SelfJoin::YourSerial 

would be the answer.

Of couse, your answers are always the best :)

No warning that calculating keys can be error-prone, guys? Seems like that's what the OP is doing..

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.