cancel
Showing results for 
Search instead for 
Did you mean: 

How can I have access to the previous previous record?

Former Member
0 Kudos

I know how to access the previous record, but I need to do some evaluation based on the previous previous record.

This is the scenario:

I need to write a header for the second record within each date if the specific condition has met.

Any advice would be greatly appreciated....thanks

I tried something like this but it didn't work

Previous(Previous({storeprocedure;1.field}))

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

As Debi says I dont think its possible, I tried to think of some logic using Variables but it was beyound me.

I see you are using a Stored Procedure, I would therefore suggeste that you add a Previous to each record in there. Then in Crystal you can use Previous() to look at that new field effectively giving you what you want.

In Oravle the LAG function will do what you want, not sure how you do it in SQL Server.

Ian

Former Member
0 Kudos

I don't think you can do that... I have not seen a function to get a previous previous record. I tried doing a previous on a formula containing a previous and that did not work either.