Using Oracle RDB on Open VMS;date arithmetic problem
880579Aug 5 2011 — edited Sep 13 2011Hello to all,
I'm writing Sql on an Itanium server running Open VMS.
The dbms version is Oracle Rdb V7.2-100
I need a very simple function that will calculate the date and time exactly 2 days in the past. We have a table in one of our RDB dbs which contains only 2 columns, an instrument reading and the date/time of the reading. we wish to store exactly 2 days worth of data in this table (down to the minute) and delete rows that have a timestamp older than that time. Computing the relevant date/time value is the hard part
This what I'm trying at present:
delete from bp_opacity where date_time <
(select current_timestamp
- interval '02:00' day to hour)
;
which doesn't work; I've tried casting both operands into several different types and nothing works. Maybe I'm just showing my ignorance here, since I'm rather new at this. Help greatly appreciated!
(date_time is the column name and is of date vms type)