Re: beginner query help

From: "Andrew Bartley" <abartley(at)evolvosystems(dot)com>
To: "Hought, Todd" <Todd(dot)Hought(at)echostar(dot)com>, "postgres" <pgsql-general(at)postgresql(dot)org>
Subject: Re: beginner query help
Date: 2004-01-08 22:11:48
Message-ID: CAEAIPJHMAFOJGDANDACKEGLDGAA.abartley@evolvosystems.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

try this

select cast('Tue Jan 6 13:36:24 2004' as timestamp)

Andrew Bartley

-----Original Message-----
From: pgsql-general-owner(at)postgresql(dot)org
[mailto:pgsql-general-owner(at)postgresql(dot)org]On Behalf Of Hought, Todd
Sent: Friday, 9 January 2004 7:49 AM
To: postgres
Subject: [GENERAL] beginner query help

Hi all, trying to run a query against a table, to pull the date out, and
order it. problem is, the date is stored in character (string) format,
not as an actual timestamp, so parsing it back into an offical 'date' is
proving tricky.
the last query that I ran, that I'm pretty sure should be working looks
like this:

(stdtime is the field with the date in numeric format, normally outpus
as: Tue Jan 6 11:36:24 2004)
select * from "table" where ticket = xxxxx order by
to_timestamp('stdtime', 'Day, Mon, DD, HH24:MI:SS, YYYY');

Something tells me this has to be wrong in some obvious way that lack of
sleep is blinding me from. :-)

thanks in advance.

-Todd Hought
todd(dot)hought(at)echostar(dot)com

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

In response to

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2004-01-08 22:30:58 Re: vacuum
Previous Message Vivek Khera 2004-01-08 21:58:01 Re: problems with transaction blocks