Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Subtracting timestamp columns in table

2604717Feb 4 2014 — edited Feb 4 2014

I have a table with 2 columns:  mach_cap_tstamp and rcvd_tstamp.  Both of these columns are TIMESTAMP datatype..

The mach_cap_tstamp always has a later date value than the rcvd_tstamp.  I need to be able to subtract the rcvd_tstamp from the mach_cap_tstamp and store the result in a TIMESTAMP format.

Example:     mach_cap_tstamp                                 rcvd_tstamp                                        result

                    03-MAR-05 07.02.09.000000 AM          03-MAR-05 02.01.02.000000 AM       should be mach_cap_tstamp - rcvd_tstamp in the same date format

Is there a way that this can be done?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 4 2014
Added on Feb 4 2014
16 comments
1,592 views