Skip to Content
author's profile photo Former Member
Former Member

How can I have access to the previous previous record?

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}))

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 25, 2011 at 12:01 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 25, 2011 at 02:21 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.