Results 1 to 5 of 5

Thread: How to refer to previous fields in 2 different row

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2006
    Posts
    3

    Smile How to refer to previous fields in 2 different row

    HI there!
    I'm new in Crystal Report programming. I have a report that generates dates in rows. I would like to calculate the different between 2 dates. For example, I would like to calculate the different dates between 1st row and 2nd row, 2nd row and 3rd row etc. The dates are from Access database and printed in Detail section. Thank you.

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: How to refer to previous fields in 2 different row

    In Crystal you can access the record before and after the current record using the Previous (it might be just Prev) and Next functions. So in your case create a formula and use the Previous function. Something like

    DateDiff(X, {TableName.FieldName}, Previous({TableName.FieldName}))

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2006
    Posts
    3

    Re: How to refer to previous fields in 2 different row

    Thank you Bruce! It works.
    Ivan H.

  4. #4
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: How to refer to previous fields in 2 different row

    Quote Originally Posted by Ivan H.
    Thank you Bruce! It works.
    Ivan H.
    If you Got the solution then go to the thread tool menu and click on the resolved this thread so people know that it is resolved

  5. #5
    Addicted Member mabbas110's Avatar
    Join Date
    Oct 2005
    Location
    Karachi , Pakistan
    Posts
    172

    Re: How to refer to previous fields in 2 different row

    Good Solution.
    Thanks and Regards,

    Muhammad Abbas

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width