Re: R: Date types in where clause of PreparedStatement

From: "Eric G(dot) Miller" <egm2(at)jps(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: R: Date types in where clause of PreparedStatement
Date: 2001-03-02 03:40:19
Message-ID: 20010301194019.B25090@calico.local
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Mar 01, 2001 at 05:33:21PM +0100, Paolo Sinigaglia wrote:
>
> >Can anybody show any reason why the code using a prepared
> > statement with a where clause using a date won't find any records
> > on PostgreSQL but WILL work using Access and the jdbc-odbc
> > bridge?
>
>
> Assuming you are running PostgreSQL on a *nix machine and the odbc client on
> a Win* different machine, couldn't be a problem of different locale
> settings?
>
> Using Delphi BDE I had **a lot** of troubles on an all-windows-98 network
> because of different locale settings among the clients. First in all,
> day-month swapping in dates (dd-mm-yyyy and mm-dd-yyyy formats mixed through
> the network).

Make all dates ISO format and life should be good. I think MS Access
does something like that for ODBC. So, yyyy-mm-dd ('2001-03-01') or
dd-MMM-yyyy ('01-Mar-2001'), are good candidates. For time as well:

yyyy-mm-dd hh:mm[:ss[-hh[mm]]] '2001-03-01 23:42:58-0800'

Always having year first makes a good heuristic that date/time is in ISO
format, and there's no question that each successive part represents a
decreasing date/time part.

--
Eric G. Miller <egm2(at)jps(dot)net>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message ryan 2001-03-02 04:16:17 Trigger Blunder
Previous Message Chris Humphries 2001-03-02 03:30:22 pgsql and *nix filesystems combo?!