Re: Fixing faulty dates - select on day part of a date field

From: Gary Stainburn <gary(dot)stainburn(at)ringways(dot)co(dot)uk>
To: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
Cc: "pgsql-sql" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Fixing faulty dates - select on day part of a date field
Date: 2001-11-30 09:19:28
Message-ID: E169jml-0003hA-00@stan.ringways.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi Chris,

I do now, hence the explicit date check of 2001/11/08 which is when I fixed
the script. BTW, it doesn't seem to matter whether I use '/' or '-'.

Gary

On Friday 30 November 2001 1:34 am, Christopher Kings-Lynne wrote:
> > update calls set date_part('day',xdate) =
> > date_part('month',xdate),
> > date_part('month',xdate) = date_part('day',xdate)
> > where date_part('day',xdate) < 13 and xdate < '2001/11/08';
> >
> > (2001/11/08 is when I found/fixed the insert problem)
>
> You should always use the ISO date format - it avoids all these problems,
> and is unambiguous. It is: YYYY-MM-DD
>
> Chris
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html

--
Gary Stainburn

This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Stephan Szabo 2001-11-30 09:29:27 Re: PL/pgSQL loops?
Previous Message Christopher Kings-Lynne 2001-11-30 08:51:59 Re: contracting tables