Tap Forms – Organizer Database App for Mac, iPhone, and iPad › Forums › Using Tap Forms › Sorting on Date and Time
- This topic has 8 replies, 2 voices, and was last updated 10 years, 2 months ago by Yogie.
-
AuthorPosts
-
September 12, 2014 at 4:28 AM #10800
YogieParticipantHi Brendan,
I have a sorting issue. I do have a date and a time field. I set the form to sort on the date first and then sort on time.
But regardless of what I set to the time (ascending/descending) there is no change in the order. I lie to have the most recent item on top.
Any thoughts on this?
Cheers
JoergAttachments:
You must be logged in to view attached files.September 12, 2014 at 10:56 AM #10803
BrendanKeymasterTap Forms stores Dates, Times, and Date & Time fields exactly the same way. They’re stored as integer values in seconds from January 1, 1970. This is known as the Unix epoch date time. So that’s why sorting first on Date and then on Time won’t work. It’s because the Time fields also have a date component to them. It’s just not being displayed. The only difference between a Date, Time, and Date & Time field is in how they’re displayed.
September 12, 2014 at 10:57 AM #10804
BrendanKeymasterSo if you switch to a Date & Time field and then sort on that, you should get proper sorting just on that one field because it already has the time built-in.
September 12, 2014 at 11:18 AM #10806
YogieParticipantHi Brendan,
that doesn’t work. Before I started to try a sort on both columns, I only had the Date column sorted. Sorting is always missing the right order. 1pm, 6am, 4pm or similar. And if I sort only on the Time column everything is mixed up and even worse. Years, Month and times are more shuffled than sorted.
Cheers
JoergSeptember 12, 2014 at 2:32 PM #10807
BrendanKeymasterSo you’ve switched to a “Date & Time” field and removed the sort for the separate Time field and it still shows out of order?
Try re-selecting the Date & Time field in the First Sort Field setting. That will force Tap Forms to re-sort all your records by that Date & Time field.
Thanks,
Brendan
September 12, 2014 at 11:52 PM #10808
YogieParticipantI’ve done a sorting on a different field and then switched back to the date column, but that is not fixing the problem. Again 1pm goes before 8am etc.
September 13, 2014 at 10:56 AM #10811
BrendanKeymasterI’d like to see a screenshot with your field changed to a Date & Time field so I can see the sorting.
September 13, 2014 at 12:19 PM #10814
YogieParticipantHi Brendan,
sure, here you go…
Cheers
JoergAttachments:
You must be logged in to view attached files.September 16, 2014 at 2:58 AM #10822
YogieParticipantThe sort function sorts the date & times following the rule like you would bring any number in an order.
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
But it is not considering that there is a difference in am and pm at the end.
So 1pm, 2pm, 3pm etc. is getting sorted before any higher number like…
1am, 1pm, 5am, 8am, 10am, 11pm, 12…
-
AuthorPosts
You must be logged in to reply to this topic.