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

Hi All,

I would like to know the best way to deal with the format of a date field. Is there a way to reformat the date on entry to include leading zeros so that they can sort propperly?

Thanks for any help :

A date field contains a value that can ALWAYS sort properly.

To see leading zeros you can format that field by changing the date format.

  • Author

Hmmm. I found the date format but it didn't help. I am using a portal sorting technique that does not sort the date right. But I do remember being warned that that would be the case. Originally I didn't expect to have any dates in this portal, but things changed. Good lesson there about being prepared for the unforseen. Guess I'll have to dig in to this solution and see what can be done.

Thanks

Verify that the Date field is "[color:red]Date" and not [color:blue]text.

  • Author

It is. The problem is that I am using a calculation based portal sort solution. It's the one that drops the field name in to a sort field. I know there was a solution for the date but at the time I implimented the solution I barely understood the technique and the date solution added more complication than I could handle. And I didn't think I would need it (Smacking forhead).

For a date field called theDate,

Year(theDate) & Right("0" & Month(theDate); 2) & Right("0" & Day(theDate); 2)

will generate

"20100412" when given April 12, 2010

This string is suitable for adding to another string for a compound key that needs to be sortable.

  • Author

Hmmm... Not exactly sure how to use that information in my solution but somehow it seems there should be a way? Should I do something like create duplicates of the two date fields I need. Sort by one that is formatted as described above and show the other? Just shootin' in the dark here...

I am using a portal sorting technique that does not sort the date right.

Post an example file that uses that technique.

  • Author

Here is my sample of the sort technique I am using.Just click the column headers to sort.

Sort_Sample.zip

I changed the two unstored calculations used for the sort keys to properly handle Date fields.

The portal sort method you have made use of GetField(). My modified technique adds Evaluate() and FieldType() to detect and handle the field of type date.

Sort_Sample_revised_fp7.zip

  • Author

You are amazing! Thank you so much for all your help :

Yes, GetAsNumber() is probably the better way to go.

  • Author

The first worked great for me and I love that I didn't have to code for the field names. I pasted the formula into my sort fields and it worked for both the date fields in my layout.

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.