I am having booking table. In that table departure date, departure time column and both are varchar2 columns. The values are like this in those columns,
Departure Date = 21/05/15
Departure Time = 22:55
I am trying to select records from that table which are having departure between sysdate + 30Hrs and sysdate + 31Hrs.
Following is my query:
select *
from xx_booking
where to_date(depdate || ' ' || deptime,'DD/MM/YY HH24:MI:SS') between sysdate + 30/24 and sysdate + 31/24
Even I tried to select using relational operators (< and >). For less than '<' it's giving result but for greater than '>' it's giving "not a valid month" error
Giving Result:
select *
from xx_booking
where to_date(depdate || ' ' || deptime,'DD/MM/YY HH24:MI:SS') < sysdate + 37/24
Giving Error:
select *
from xx_booking
where to_date(depdate || ' ' || deptime,'DD/MM/YY HH24:MI:SS') >sysdate + 37/24
So I am bit confused why this query working like this. Please show some light to solve this issue.