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.

Sorting issues

Featured Replies

Hello,

I've set up a script to sort records in a Health and Safety Database, but two of my fields are in number format, while the rest are text.

My Serial Number fields is sorting like 1, 11, 12, 2. I want it to sort numerically like 1, 2, 11, 12.

How do I fix this?

Thank you!

Richard

H&S Database Test.fmp12 2.zip

Try this for the Sort List Key calc - and make sure the popup selection field is Sort Selection, not Sort List Key.

Also, you should check the options for the Serial Number.

Let

( [

theSortField = GetField ( Sort Selection ) ;

theSortName = GetFieldName ( theSortField ) ;

fieldTypeIsNumber = PatternCount ( FieldType ( Get ( FileName ) ; theSortName ) ; "number" )

] ;

Case ( fieldTypeIsNumber ; Right ( "00000000" & theSortField ; 9 ) ; theSortField )

)

Will work till your billionth record!

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.