gnumed-bugs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-bugs] Unable to search by date in patient search field


From: Jim Busser
Subject: Re: [Gnumed-bugs] Unable to search by date in patient search field
Date: Sun, 17 Jul 2011 14:28:46 -0700

-- Jim

On 2011-07-17, at 12:45 PM, Karsten Hilbert wrote:

> This query fails due to PostgreSQL not being able to parse
> "3/21/1931" as a timestamp which, in turn, is due to the
> DateStyle setting:
> 
>> 2011-07-17 11:13:10  DEBUG     gm.db 
>> (/Users/djb/Downloads/gnumed-client.0.9.7/Gnumed/pycommon/gmPG2.py::__log_PG_settings()
>>  #1672): PG option [DateStyle]: ISO, DMY
> 
> just like the HINT says:
> 
>> HINT:  Perhaps you need a different "datestyle" setting.
> 
> The available choices would be DMY, YMD, and MDY. The letter
> would tell PostgreSQL how to parse "3/21/1931". We can,
> however, only choose one of the above (or else it would
> simply be other strings that can't be parsed).

Here is what I don't get…

even

        1931.03.21
        1931.3.21
        1931/3/21
        1931/03/21
        1931-03-21
        1931-3-21

        (all ISO)

and

        21-3-1931
        21-03-1931
        21/3/1931
        21/03/31
        21.3.1931
        21.03.1931

        (all DMY)

are all rejected. Also, shouldn't 1931-03-21 be accepted and properly parsed 
always, or is that true only when Postgres knows we are necessarily talking 
about a date (which it cannot know without somehow being helped if we are 
talking the patient combo search box) ?

If this is not a bug, I am not sure how I am supposed to manage it…

-- Jim
        


reply via email to

[Prev in Thread] Current Thread [Next in Thread]