Re: Fixing faulty dates - select on day part of a date field - Mailing list pgsql-sql

From Christopher Kings-Lynne
Subject Re: Fixing faulty dates - select on day part of a date field
Date
Msg-id GNELIHDDFBOCMGBFGEFOEEKBCAAA.chriskl@familyhealth.com.au
Whole thread Raw
In response to Re: Fixing faulty dates - select on day part of a date field  (Gary Stainburn <gary.stainburn@ringways.co.uk>)
Responses Re: Fixing faulty dates - select on day part of a date field
List pgsql-sql
> 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



pgsql-sql by date:

Previous
From: "Peter T. Brown"
Date:
Subject: contracting tables
Next
From: "Christopher Kings-Lynne"
Date:
Subject: Re: Can I CONSTRAIN a particular value to be UNIQUE?