Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can this be done within a single formula?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have the following information within one record:

Record ID: 01

User Group Datetime Entry_type
BSMITH ADMIN Blah Viewed Record
AHALL OPS Blah Resumed Record
BSMITH ADMIN Blah Closed Record
JCOMPTON OPS Blah Transferred Record
EXPERT OPS Blah Record Created

I need to select when the record was created, transferred, resumed, and closed. With that information I need to do a datediff between them. Example: datediff(created, transferred) or anyone of the combos I listed.
 
Group by Record ID
Create 5 formulas that look like this, one for each record type:

If {xxx.Entry_type} = "Viewed Record"
then {xxx.dateTime}

Put these on the details band and insert a summary of each that calculates the maximum of each group. You will now have all 5 dates, side-by-side on the group footer.

These max values will appear with Sigmas in your formula editor, and can be used to add and subtract. Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Thanks for the info, that is the direction I had already taken.. Thought there might have been a cleaner way of doing it. If I can ask just one question about it..

The summary will not always have information. I've attempted the following formula:

IF NOT ISNULL(Maximum ({@EVOpen}, {PROBLEMS.PROBLEM_ID}))
AND NOT ISNULL(Maximum ({@ResumedBy}, {PROBLEMS.PROBLEM_ID})) THEN
datetimediff(Maximum ({@EVOpen}, Maximum ({@ResumedBy})

The only time it will give me null, is when both evopen & resumedby are null. If one has information, and the other does not, it displays a very large negative date.
Is there a way around this?

Thanks for you time.
 
I think you should put the boolean in parantheses if you are going to use NOT:

NOT (..your boolean..)

But, I don't trust IsNull against a summary.
I would try:

IF Maximum ({@EVOpen}, {PROBLEMS.PROBLEM_ID}) > Date(1900,1,1) ... Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top