Re: Newbie Date Problems

From: John Nix <maximum(at)shreve(dot)net>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Newbie Date Problems
Date: 2002-05-09 19:41:44
Message-ID: Pine.LNX.4.44.0205091440330.24462-100000@server.sblug.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


Thanks for the help... I checked the formatting functions section and it
helped a lot.

update clients set date_raw = to_char(timestamp (date_year || '-' ||
date_month || '-' || date_day), 'YYYY-MM-DD') where clients_id='835';

That seems to work...

John

On Thu, 9 May 2002, Josh Berkus wrote:

> John,
>
> > update table set date_iso = (date_year || '-' || date_month || '-' ||
> > date_day) where table_id='838
>
> You'll appreciate the fix, which takes less time to write than you took
> to write your question:
>
> You need to use the to_char function to format your date fragments as
> strings with the proper number of digits:
>
> ltrim(to_char(date_month, '00'))
>
> See "formatting functions" in the docs (under "functions and
> operators") for more help.
>
> -Josh Berkus
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Doug Silver 2002-05-10 00:26:13 Converting epoc number to timestamp
Previous Message Josh Berkus 2002-05-09 19:28:24 Re: Newbie Date Problems