pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gary Stainburn <gary.stainburn@ringways.co.uk>
To: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Fixing faulty dates - select on day part of a date field
Date: Thu, 29 Nov 2001 11:31:24 +0000
Message-ID: <E169PMt-0005zg-00@stan.ringways.co.uk> (raw)

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     



view thread (7+ messages)  latest in thread

Message-ID: <E169PMt-0005zg-00@stan.ringways.co.uk>
Permalink:  ../E169PMt-0005zg-00@stan.ringways.co.uk/
Also on:    postgresql.org/message-id/E169PMt-0005zg-00@stan.ringways.co.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: gary.stainburn@ringways.co.uk
  Subject: Re: Fixing faulty dates - select on day part of a date field
  In-Reply-To: <E169PMt-0005zg-00@stan.ringways.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox