Home » Developer & Programmer » Reports & Discoverer » How to subtract previous row from current row in Oracle Report (Oracle Report 10g)
How to subtract previous row from current row in Oracle Report [message #662857] Sun, 14 May 2017 02:36 Go to next message
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

Re: How to subtract previous row from current row in Oracle Report [message #662860 is a reply to message #662857] Sun, 14 May 2017 04:22 Go to previous message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Quote:
I got a command LAG for SQL Query but it is not supported in Report.
Then create a view with this query and select this view.

Previous Topic: Run Reports In Maximize Mode
Next Topic: rep 1800 formatter error
Goto Forum:
  


Current Time: Thu Mar 28 15:30:20 CDT 2024