Question

I'm trying to write a query on a column that's of the time "Timestamp without timezone" and this is my where clause:

and (cv.expire_ts >= 'today' or ifnull(cv.expir_ts, '') = '')

I get the following error:

Error: 'today' is invalid format or value for timestamp without time zone or timestamp with local time zone. Please enter a valid timestamp value in yyyy-mm-dd hh:mm:ss[.fff...] format.
SQLState:  22007
ErrorCode: 4328
Error: Specified cursor is not known to the server.
SQLState:  24000
ErrorCode: 590366

How can I make this query work on this type of column?

Was it helpful?

Solution

Try using the CURRENT_DATE constant, without quotes.

OTHER TIPS

I think missing part is date function for 'today'

Refer

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top