Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

PostgreSQL : Hint: No operator matches the given name and argument types

When I execute my query I have this error :

Query failed: ERROR: operator does not exist: "GOOD_RECIEPT_ANOMALY_DETECTION_V2_last_alerts_sent_gsheet_histo" > timestamp without time zone Hint: No operator matches the given name and argument types. You might need to add explicit type casts. Position: 176

Here is my SQL query :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

SELECT *
FROM "GOOD_RECIEPT_ANOMALY_DETECTION_V2_last_alerts_sent_gsheet_historic"
WHERE "GOOD_RECIEPT_ANOMALY_DETECTION_V2_last_alerts_sent_gsheet_historic.PO_Creation_date" > 
CURRENT_DATE - INTERVAL '1 month'

I work on PostgreSQL database.
I think the problem comes from the PO_Creation_date type but I don’t understand that it should be cast since it is in date format

>Solution :

use ::DATE

SELECT *
FROM "GOOD_RECIEPT_ANOMALY_DETECTION_V2_last_alerts_sent_gsheet_historic"
WHERE "GOOD_RECIEPT_ANOMALY_DETECTION_V2_last_alerts_sent_gsheet_historic"."PO_Creation_date"::DATE > CURRENT_DATE - INTERVAL '1 month'
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading