I have a column date and column time on my PostgreSQL table. I wish to make a query, to filter rows that are not expired based on date and time. I tried this, but it does not works and returns an error Postgrex.Error) ERROR 42601 (syntax_error) syntax error at or near :
from q in Line, where: fragment("date ? + time ? > NOW()", q.date, q.time)
If you have the option, I’d recommend storing the values together in a single datetime column. Keeping them separate is going to make most things harder. Also, the time column by itself has no semantic meaning. It’s effectively 10AM on any day for example.