This is my current oracle table:
- DATE = date
- HOUR = number
- RUN_DURATION = number
I need a query to get RUN_DURATION between two dates with hours like
Select * from Datatable where DATE BETWEEN to_date('myStartDate', 'dd/mm/yyyy hh24:mi:ss') + HOURS? and to_date('myEndDate', 'dd/mm/yyyy hh24:mi:ss') + HOURS?
For example all data between 30.10.14 11:00:00 and 30.10.14 15:00:00
I stuck to get the hours to the dates. I tried to add the hours into myStartDate but this will be ignored for the start date because of BETWEEN
.
I know BETWEEN
shouldn't be used for dates but I can't try other opportunities because I don't know how to get DATE
and HOUR
together...
Thanks!
BETWEEN
with dates. Are you trying to add theHOUR
column to theDATE
column? Its very unclear. – Famous