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

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Gary Stainburn" <gary(dot)stainburn(at)ringways(dot)co(dot)uk>, "Markus Bertheau" <twanger(at)bluetwanger(dot)de>
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 01:34:33
Message-ID: GNELIHDDFBOCMGBFGEFOEEKBCAAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Christopher Kings-Lynne 2001-11-30 01:54:29 Re: Can I CONSTRAIN a particular value to be UNIQUE?
Previous Message Peter T. Brown 2001-11-29 23:50:44 contracting tables