Re: Newbie Date Problems - Mailing list pgsql-novice

From Josh Berkus
Subject Re: Newbie Date Problems
Date
Msg-id web-1455454@davinci.ethosmedia.com
Whole thread Raw
In response to Newbie Date Problems  (John Nix <maximum@shreve.net>)
Responses Re: Newbie Date Problems  (John Nix <maximum@shreve.net>)
List pgsql-novice
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

pgsql-novice by date:

Previous
From: John Nix
Date:
Subject: Newbie Date Problems
Next
From: John Nix
Date:
Subject: Re: Newbie Date Problems