Brian Dunning's FileMaker Custom Functions

DateToSortableText ( thedate )

Returns a sortable textual representation of a date value

  Average rating: 4.3 (33 votes) Log in to vote

Theo Ros   Theo Ros

Share on Facebook Share on Twitter

  Sample input:
DateToSortableText ( Get ( CurrentDate ) )
  Sample output:
20050530 (if today is May 30, 2005)

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Returns a sortable textual representation of a date value.
To text-sort dates, you will have to place the biggest unit (year) first,
followed by the month an day.
This will result in textvalues that will sort correctly, for instance
in a portal-sort solution.

Syntax: DateToSortableText ( thedate )
Return type: Text



Log in to post comments.


Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 15 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth:

Under construction. Email me your wish list for improvements.