Creating a date filter

Hi there!

I’ve created a SQL query with a date filter, but I’m having a bit of trouble with the date format. The date is stored in the database as May 1, 2025, 2:32 PM, but when I select a date in the date picker (introduced by the filter), it shows up as a date without a time stamp. Can you help me out with this?

Here is the error I am getting: ERROR: syntax error at or near "=" Position: 765

For the “Field to map to” field, I’ve selected the “created_at” column from the orders table. I’ve also tried all the options for the “Filter widget type,” including single date and date range filters.

When I comment out the date filter portion of the query, the query works perfectly. This suggests that the issue lies in how I’m comparing dates.

I would greatly appreciate any assistance you can provide!

Here is my query

SELECT o.number AS "Order Number",
o.created_at AS "Order Date",
f.NAME AS "Facility",
c.NAME AS "Carrier",
po.identifier AS "ULI",
po.created_at AS "Appointment Date"
FROM orders o
LEFT JOIN facilities f
ON o.facilities_id = f.id
LEFT JOIN carriers c
ON o.carrier_id = c.id
LEFT JOIN shippers s
ON f.shipper_id = s.id
LEFT JOIN purchase_orders po
ON o.number = po.identifier
WHERE s.NAME = 'Customer' -- customer name
and f.name = {{facility}}
and o.created_at = {{order_date}}
ORDER BY o.created_at DESC