473,796 Members | 2,536 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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('s tdtime', '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*********@ech ostar.com

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

http://archives.postgresql.org

Nov 12 '05 #1
1 1833
try this

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

Andrew Bartley

-----Original Message-----
From: pg************* ****@postgresql .org
[mailto:pg****** ***********@pos tgresql.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('s tdtime', '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*********@ech ostar.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 YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 12 '05 #2

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

Similar topics

3
2873
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 ... it is the most elegant and graceful language I have ever used (Fortran, Cobol, Basic, many assemblers, Forth, C, VB, etc.). I don't have the resources or the
10
2092
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 data, data for the shares and a form where I register how many shares each owner owns. Now to the difficult(?) issue. I need to set a number for the shares so I can make an ownership report showing wich sharenumbers people owns. I have thougt...
1
1535
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 performed at different hospitals and reports based on the queries to print out the relavent details. What I would like to do is have a summary sheet in the Report Footer section that lists a grid of each type of procedure performed as well as the...
1
1619
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 would like to browse the form in alphabetical order, but instead it goes in order of autonumber which jumbles the list of restaraunts so they are not in alphabetical order. i would appreciate any help!
3
1786
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 have have successfully sent and recieved using the PING, AUTHENTICATE (send in username and password and return a secuirity token), SOLICIT(send in information for a query and get a number indicating the query),
2
3611
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 it will pass to the query called "qry_WkReq" is "Yes" and "No." (The field being requeried is a Yes/No type field.) After this, I created an event procedure after update and coded:
1
1830
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 what it's capacity is. If I'm barking up the wrong tree, what should I be considering instead ?
2
1489
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 command button used are only to execute the different queries on click event. I have put the GridView control which is used to show the database stored related to that form. I m using SQL DataSource control for the connection. Now,my problem is i m...
2
1542
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 example of what I've done... I have several tables e.g. Table 1 Product No.------------Stock Holding A1-------------------------10
0
9528
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10456
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10230
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10174
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10012
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6788
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5442
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.