query [message #389137] |
Fri, 27 February 2009 06:36 |
rajasekhar857
Messages: 500 Registered: December 2008
|
Senior Member |
|
|
hi,
i am having a query like this.
select TO_CHAR(appointment_Date,'DD-MM-YYYY HH:MI:SS AM') from emrencounterdetails.
the o/p shows like this
28-01-2009 12:00:00 AM
28-01-2009 12:00:00 AM
28-01-2009 12:00:00 AM
what i want is the current time needed to put in that.can you guide me how to change that
|
|
|
Re: query [message #389139 is a reply to message #389137] |
Fri, 27 February 2009 06:46 |
joicejohn
Messages: 327 Registered: March 2008 Location: India
|
Senior Member |
|
|
@rajasekhar857,
You mean you want to concatenate the date with something like
SQL> SELECT to_char(sysdate, 'HH24:MI:SS') FROM Dual;
TO_CHAR(
--------
18:29:28
Regards,
Jo
|
|
|
Re: query [message #389143 is a reply to message #389139] |
Fri, 27 February 2009 07:05 |
rajasekhar857
Messages: 500 Registered: December 2008
|
Senior Member |
|
|
its working fine with
SELECT to_char(sysdate,'DD-MM-YYYY HH24:MI:SS PM') FROM emrencounterdetails;
showing o/p as
27-02-2009 18:35:02 PM
but for this its not showing correctly
SELECT to_char(appointment_date,'DD-MM-YYYY HH24:MI:SS PM') FROM emrencounterdetails;
showing o/p as
28-01-2009 00:00:00 AM
can you tell me why it is happening like this
|
|
|
Re: query [message #389144 is a reply to message #389143] |
Fri, 27 February 2009 07:08 |
pablolee
Messages: 2882 Registered: May 2007 Location: Scotland
|
Senior Member |
|
|
Because your appoinment date column has got a time element value of 00:00:00 AM
Presumably, when someone inserted the values, they did not include a time.
|
|
|
|
Re: query [message #389147 is a reply to message #389145] |
Fri, 27 February 2009 07:14 |
pablolee
Messages: 2882 Registered: May 2007 Location: Scotland
|
Senior Member |
|
|
Your column does Not contain time (effectively) do you have another (different) column that contains the appointment time by any chance?
|
|
|
Re: query [message #389149 is a reply to message #389145] |
Fri, 27 February 2009 07:16 |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
You can't - that data does not exist.
When the appointment_date column was populated, the time component was removed (or not included).
|
|
|
|