Home » SQL & PL/SQL » SQL & PL/SQL » Function
Function [message #1952] Wed, 12 June 2002 10:47 Go to next message
Jayam
Messages: 1
Registered: June 2002
Junior Member
Hi
I need a function that should return as follows
Input Return Value
8:00 08:00
08:00 08:00
8:00PM 20:00
08:00PM 20:00
8:00 AM 08:00
08:00 AM 08:00
others Null

Thanx in advance
Regards
Jayam
Re: Function [message #1954 is a reply to message #1952] Wed, 12 June 2002 12:24 Go to previous message
Amit Chauhan
Messages: 74
Registered: July 1999
Member
Hi,
This is an SQL query that may fulfill your requirement :

SELECT LPAD(TO_CHAR(TO_DATE(REPLACE('8:00AM', ' ', ''), 'hh:miPM'), 'hh24:mi'), 5, '0')
FROM DUAL
/

Hope that helps.
Thanks
Amit
Previous Topic: Pre Sorted Table on column other than Primary Key(Very-very urgent)
Next Topic: PL/SQL
Goto Forum:
  


Current Time: Thu Apr 18 04:17:53 CDT 2024