Received: from stan.ringways.co.uk ([213.38.87.130]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fATBWrm51357 for ; Thu, 29 Nov 2001 06:32:54 -0500 (EST) (envelope-from gary.stainburn@ringways.co.uk) Received: from gary.ringways.co.uk ([10.1.1.2] helo=there) by stan.ringways.co.uk with smtp (Exim 3.33 #2) id 169PMt-0005zg-00 for pgsql-sql@postgresql.org; Thu, 29 Nov 2001 11:28:39 +0000 Content-Type: text/plain; charset="iso-8859-1" From: Gary Stainburn Organization: Ringways Garages Ltd To: "pgsql-sql" Subject: Fixing faulty dates - select on day part of a date field Date: Thu, 29 Nov 2001 11:31:24 +0000 X-Mailer: KMail [version 1.3.1] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: X-Archive-Number: 200111/403 X-Sequence-Number: 5785 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