473,327 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

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
to*********@echostar.com

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

http://archives.postgresql.org

Nov 12 '05 #1
1 1807
try this

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

Andrew Bartley

-----Original Message-----
From: pg*****************@postgresql.org
[mailto:pg*****************@postgresql.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
to*********@echostar.com

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

http://archives.postgresql.org


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Art | last post by:
NEWBIE ALERT! Esteemed List Participants and Lurkers: (System: P-II 350, 192 meg, Win98 SE, Python 2.2.3, wxPythonWIN32-2.4.1.2-Py22.exe) I'm having a lot of fun getting started with Python...
10
by: StenKoll | last post by:
Hi! I am fairly new to access and not very familiar with vba programming. I am trying to setting up a database of shareholders in a company. So far I have managed to build tables containing owner...
1
by: Simon Matthews | last post by:
Hope someone can help an Access beginner! I've just started keeping my surgical logbook on access and it's a simple flat-file affair. I have created several queries that will list cases...
1
by: asif | last post by:
hello all, i'm a beginner to access and i'm having trouble with autonumbers. basically i have a list of restaraunts in a table. they are sorted ascending by autonumber (1 to 283) although i...
3
by: Rodney Garland | last post by:
Hi All, I am a relative beginner to Python and am looking for help with sending and XML message and getting back a return file. The server is: https://node.deq.state.or.us/node/node.asmx I...
2
by: jay | last post by:
Hi. I have created an unbound combo box in a form whose purpose is to pass parameters to a query and then requery the requery. The unbound combo box is named "ClosedFilter" The two parameters...
1
by: bob | last post by:
Hello, First of all, does anyone know whether dbus will allow be to do 3 things: 1. query whether or not there is a dvd drive. 2. query whether or not there is a blank disc in it. 3. query...
2
by: Riaaaa | last post by:
I m beginner for ASP.Net 2005 with C# and SQL Server 2005. I have created the form which contains many asp standard controls on it like label,textbox,checkbox,dropdownlist,command button. The...
2
by: BlackEyedPea | last post by:
Hi, I'm very very new to access but hopefully I'm learning quickly. I need some help on what I think maybe as a result of me having a little tunnel vision on my database & confusing myself. An...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.