How to subtract previous row from current row in Oracle Report [message #662857] |
Sun, 14 May 2017 02:36 |
|
malya
Messages: 22 Registered: August 2015 Location: Hyderabad, India
|
Junior Member |
|
|
Hi Seniors,
I am struck with some peculiar problem in Oracle Report. I have to subtract a date field from previous record to current record date field.
The record structure is mentioned below :
SNo VechileNo Date_InTime Date_OutTime
---------------------------------------------
1 ABC123 14/05/2017 06:00 AM 14/05/2017 06:20 AM
2 ABC123 14/05/2017 06:40 AM 14/05/2017 06:55 AM
3 ABC123 14/05/2017 07:05 AM 14/05/2017 07:25 AM
Requirement/Output should be
SNo VechileNo Date_InTime Date_OutTime Turnaround Time
-----------------------------------------------------------------------------
1 ABC123 14/05/2017 06:00 AM 14/05/2017 06:20 AM 0
2 ABC123 14/05/2017 06:40 AM 14/05/2017 06:55 AM 35 Mins
3 ABC123 14/05/2017 07:05 AM 14/05/2017 07:25 AM 30 Mins
so, I want to calculate turnaround time for the vehicle.
I got a command LAG for SQL Query but it is not supported in Report. I tried some logic in Formula column but no luck.
Is there any way to store previous record in report builder ??
Please help. Thanks in advance.
[Updated on: Sun, 14 May 2017 02:36] Report message to a moderator
|
|
|
|