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

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

Recommended Posts

Posted

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 :

Posted

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.

Posted

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

Posted

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

Posted

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).

Posted

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.

Posted

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...

Posted

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

Post an example file that uses that technique.

Posted

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.

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