Sorting on Date and Time

Viewing 8 reply threads
  • Author
    Posts
  • September 12, 2014 at 4:28 AM #10800

    Yogie
    Participant

    Hi 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
    Joerg

    Attachments:
    You must be logged in to view attached files.
    September 12, 2014 at 10:56 AM #10803

    Brendan
    Keymaster

    Tap 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

    Brendan
    Keymaster

    So 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

    Yogie
    Participant

    Hi 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
    Joerg

    September 12, 2014 at 2:32 PM #10807

    Brendan
    Keymaster

    So 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

    Yogie
    Participant

    I’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

    Brendan
    Keymaster

    I’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

    Yogie
    Participant

    Hi Brendan,

    sure, here you go…

    Cheers
    Joerg

    Attachments:
    You must be logged in to view attached files.
    September 16, 2014 at 2:58 AM #10822

    Yogie
    Participant

    The 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…

Viewing 8 reply threads

You must be logged in to reply to this topic.