I Have a table of bookings with a date time column. called scheduled.
I want to get out the rows that are in the future I’m trying to do the following but I get an error about it being a string rather than a date can anyone help with this.
{% set queryparam = "&scheduled__gt=" + local_dt|unixtimestamp %}
{% set allBookingsFuture = hubdb_table_rows('session_bookings',queryparam) %}
Hi Rohan,
Out of interest I tried to replicate your problem. But your code worked perfectly for me. The only way I could generate an error was if I tried to use the gt filter on a text field. Then the exact error I got was:
“BadRequestException: error when listing rows for table 8675309 for portal 90210: Filter ‘gt’ is not supported for the column type ‘TEXT’”
Out of interest Is that the same error you’re getting? If not, maybe you could copy/paste it or screencap it so we can try to replicate.
If you are getting the above error it’d seem that your column “scheduled” isn’t a date/time field. Which is odd.
Have you tried it out with a fresh test database?
Barry it turned out there was an issue on a different line, but the designer was incorrectly reporting it on this line.
Which was throwing us out completely
Glad to hear you got it sorted out!