Re: Extract from date field

From: Thom Brown <thom(at)linux(dot)com>
To: James David Smith <james(dot)david(dot)smith(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Extract from date field
Date: 2011-06-18 17:59:56
Message-ID: BANLkTimENTn+XcYQ6jxZM17hKLU1KBXoOw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 18 June 2011 18:54, Thom Brown <thom(at)linux(dot)com> wrote:
> So essentially you'd have to do something like:
>
> INSERT INTO camdengps2 (date_time, incident, camdencrimes_link)
> VALUES ('2011-04-18', 4, (to_char('2011-04-18'::timestamp, 'DDMMYYYY')
> || incident))::int);

Correction, that last bit shouldn't be incident but just 4 on its own
in order to demonstrate my point.

--
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message LALIT KUMAR 2011-06-18 18:31:55 Compare dates
Previous Message Thom Brown 2011-06-18 17:54:50 Re: Extract from date field