Query not producing expected result

From: Chuck Martin <clmartin(at)theombudsman(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Query not producing expected result
Date: 2019-05-01 16:26:47
Message-ID: CAFw6=U2AisghJ2cOPOWopmk3NVVJ-WcSTNM+6K_-kQVBGxzMaA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I need help figuring out why a query is not returning the records I expect
it to. I'm searching on a DateTime column (timestamp without time zone -
not nullable). The query includes:

AND event.Primaryresp_fkey = 5000011 AND event.DateTime <= 'May-1-2019'
AND event.EventDone < 1

This does not return a record that has a DateTime value "May 1, 2019 9:52
AM". If I modify the query to:

AND event.Primaryresp_fkey = 5000011 AND event.DateTime <= 'May-2-2019'
AND event.EventDone < 1

it does return the record in question. I assume I am not doing the data
comparison correctly, but don't know why.

Chuck Martin
Avondale Software

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Julien Rouhaud 2019-05-01 16:39:22 Re: Query not producing expected result
Previous Message Charlin Barak 2019-05-01 14:31:58 Re: Oracle number to PostgreSQL