Home » RDBMS Server » Server Administration » Urgent
Urgent [message #372785] Fri, 09 March 2001 09:30 Go to next message
Bobby
Messages: 32
Registered: August 2000
Member
I want to get datetime from a table. I'm using the following query.

select to_char(datetime,'dd-mm-yyyy hh:mm:ss') from table_name.

This query returns me a single time .ie 12.06.00.

How to get the different times along with dates.

Its urgent
Re: Urgent [message #372789 is a reply to message #372785] Fri, 09 March 2001 10:27 Go to previous messageGo to next message
Sudhir M. Pongurlekar
Messages: 8
Registered: January 2001
Junior Member
Have U entered different time while entering the data?
Re: Urgent [message #372790 is a reply to message #372785] Fri, 09 March 2001 11:00 Go to previous messageGo to next message
Bobby
Messages: 32
Registered: August 2000
Member
yes the sysdate was entered in default.
Re: Urgent [message #372791 is a reply to message #372785] Fri, 09 March 2001 11:09 Go to previous messageGo to next message
Sudhir M. Pongurlekar
Messages: 8
Registered: January 2001
Junior Member
If the time is entered specifically while entering the date then it will be retrieved while querying.
Re: Urgent [message #372792 is a reply to message #372785] Fri, 09 March 2001 11:25 Go to previous messageGo to next message
Gerard Vaz
Messages: 9
Registered: September 1999
Junior Member
Try setting the NLS_DATE_FORMAT parameter as follows at the SQL prompt

SET NLS_DATE_FORMAT='DD-MON-YYYY HH:MI:SS'

and then run your query.

Hope this helps.
Re: Urgent [message #372793 is a reply to message #372785] Fri, 09 March 2001 11:35 Go to previous messageGo to next message
Gerard Vaz
Messages: 9
Registered: September 1999
Junior Member
Hi there!

I just noticed that your date picture format is incorrect. Instead of DD-MM-YY HH:MI:SS you have DD-MM-YY HH:MM:SS. The MM in the time format will return you the month.

Please let me know if your problem is solved.
Re: Urgent [message #372817 is a reply to message #372785] Sun, 11 March 2001 23:39 Go to previous message
vishal gupta
Messages: 111
Registered: March 2001
Senior Member
Gerard Vaz

DD-MM-YY HH:MI:SS is the correct date picture format. If you use DD-MM-YY HH:MM:SS then month will be rreturned instead of minute.

Vishal Gupta
Previous Topic: con file
Next Topic: Please Help. insert data
Goto Forum:
  


Current Time: Mon Jun 17 08:34:19 CDT 2024