Crystal reports-get previous database field

Posted on 2006-04-04
Last Modified: 2008-03-04
I have a crystal report showing deal numbers and their corresponding cash flows. It looks something like this:

Deal no       Cash flow amount         Cash flow date
1                 5,555                             2006-03-01
1                 6,899                             2006-04-01
1                 5,000                             2006-04-03
2                 300                                2006-02-01
2                 55                                  2006-04-01
3                 428                                2006-01-01
3                 300                                2006-02-01

In the report I need to include an additonal field indicating on which date the previous cash flow of the deal took place, i.e. something like this:

Deal no       Cash flow amount         Cash flow date            Previous cash flow date
1                 5,555                             2006-03-01                        -
1                 6,899                             2006-04-01               2006-03-01  
1                 5,000                             2006-04-03               2006-04-01                
2                 300                                2006-02-01                       -
2                 55                                  2006-04-01               2006-02-01                      
3                 428                                2006-01-01                        -
3                 300                                2006-02-01               2006-01-01  

How do I "save" the previous cash flow date to appear as information in connection with the next cash flow?

Kind regards
Question by:i98petku
    LVL 28

    Accepted Solution

    Create a formua like this and place it next to Cash Flow Date:

    if not onfirstrecord and previous({table.dealno}) = {Orders.dealno} then

    Author Comment

    You have really saved me some time there. Thanks! It works great!


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
    Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now