Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 30, 2012 05:04 AM by -_-
Member
376 Points
1046 Posts
Dec 28, 2012 02:51 PM|LINK
my input parameter (input_time) is string format input time range from '0:00' to '24:00', but why i can't compare the input is after 20:00 or not. (Oracle)
----------------------------------------------------------------------------------------------
if(to_date(input_time,'HH24:MI')>=to_date('20:00','HH24:MI')) then
variable_a:='1';
else
variable_a:='2';
end if;
when input_time = '22:00', it fall into else section(variable_a=2) , why?
Contributor
3970 Points
1096 Posts
Dec 28, 2012 03:59 PM|LINK
You overengineered it. If the input parameter is a string, and you want to compare it to another string, you don't need the to_date function.
Dec 29, 2012 08:45 AM|LINK
Dec 30, 2012 05:04 AM|LINK
-_-
Member
376 Points
1046 Posts
how can i compare the time (oracle package)
Dec 28, 2012 02:51 PM|LINK
my input parameter (input_time) is string format input time range from '0:00' to '24:00', but why i can't compare the input is after 20:00 or not. (Oracle)
----------------------------------------------------------------------------------------------
if(to_date(input_time,'HH24:MI')>=to_date('20:00','HH24:MI')) then
variable_a:='1';
else
variable_a:='2';
end if;
when input_time = '22:00', it fall into else section(variable_a=2) , why?
Dan Bracuk
Contributor
3970 Points
1096 Posts
Re: how can i compare the time (oracle package)
Dec 28, 2012 03:59 PM|LINK
You overengineered it. If the input parameter is a string, and you want to compare it to another string, you don't need the to_date function.
-_-
Member
376 Points
1046 Posts
Re: how can i compare the time (oracle package)
Dec 29, 2012 08:45 AM|LINK
-_-
Member
376 Points
1046 Posts
Re: how can i compare the time (oracle package)
Dec 30, 2012 05:04 AM|LINK