Datasets Date Time vs Time

I have a dataset that was modeled after the guide for using datasets and Media Room Bookings, found here.

The example that is used, "NOW() > dtMeetingStart AND NOW() < dtMeetingFinish”, to filter the displayed content between two dates and times is what I am after. I would like to display content based on time of day without using the date as a factor. How would I go about doing this?

I have tried curtime() but with the date in the dataset it does not work. I think I might also be running into a problem of strings vs numeric content.

Edited: To make sense. :dizzy_face: Staring at the screen again too long.

I’ve not tested it, but CURTIME() can also return a number rather than a string, so perhaps enter your times as integers - ie

080000
145500

then a filter like

(CURTIME() + 0) > tStart AND (CURTIME() + 0) < tFinish

So by using CURTIME in a numeric context MySQL should treat them as numbers.

Alex

1 Like

@alex

Brilliant!

I changed the Data Type to Number and then adjusted the data as needed. Entered
(CURTIME() + 0) > tStart AND (CURTIME() + 0) < tFinish
into the filter.

Thank you! Have I mentioned how I love this software? I do. Now I have backgrounds that change according to time and using a dataset.

1 Like