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

From Gary Stainburn
Subject Fixing faulty dates - select on day part of a date field
Date
Msg-id E169PMt-0005zg-00@stan.ringways.co.uk
Whole thread Raw
Responses Re: Fixing faulty dates - select on day part of a date field  (Patrik Kudo <kudo@partitur.se>)
Re: Fixing faulty dates - select on day part of a date field  (Markus Bertheau <twanger@bluetwanger.de>)
List pgsql-sql
Hi all,

I've got a problem with dates on one of my tables. I've been inserting dates 
in the format 'dd/mm/ccyy' which for the days 13-31 for each month worked 
fine.

The problem I have is that for the days 01-12 for each month, the date was 
interpretted as 'mm/dd/ccyy'.  Now I know about it I need to fix it.

Two questions.

1) how can I select on part of a date?  I need to select all records where 
the day is not > 12.
2) can I do this in a single update, i.e. can I do something around

update calls set xdate =  ???? where ??????;

-- 
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     


pgsql-sql by date:

Previous
From: Brent Verner
Date:
Subject: Re: date_part vs extract
Next
From: Patrik Kudo
Date:
Subject: Re: Fixing faulty dates - select on day part of a date field