Help. Repeater how can I sort by a column with date AND time?

There must be an easy way of doing this but stuck at the moment.

I have a repeater that has a list of events. I have created a date / time column and trying to sort by this. I have used format MM/DD/YYYY, HH:MM:SS (will translate to UK format later). Reason I want to sort is that I will have a control to add more events.

date time sort.rp (60.0 KB)

The date sort on the repeater works but can’t get it to also sort on the time.

I have tried a couple of different things such as two columns for date & time. Also tried to create a datetime string and sort as a number and display using substr (which obviously with hindsight doesn’t work)

Any help would really be appreciated, starting to do my head in :smiley:

Cheers

Hi, Tony.

What about storing the time as a number? The hours would be whole numbers from 0 to 23, and the minutes would be decimals. For example, 9:45 AM would be 9.75, 2:14 PM would be 14.233, etc.

You’d have to convert from decimal time when displaying it in the repeater rows, and to decimal time when someone adds a row, but it would fix your sorting issue.

Jeff

Hmmm. Is this what you were looking for?

date time sorted.rp (60.5 KB)

(Sort time as text may seem silly, yes…)

Hi Jeff,

Thanks for the suggestion, will give it a go :+1:

OK, I didn’t realise that if you apply two sorts on the a repeater the second one doesn’t fully overwrite the first. SIMPLE WHEN YOU KNOW HOW!!!

Thank you asbjorn. Been driving me nuts