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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Totals Fields - Evaluate 'OR' statement 1

Status
Not open for further replies.

Cozmo2

Technical User
Apr 7, 2006
87
US
I am using Crystal 9.2.
I want to add a running total to my report that counts the record if the state = "IL" AND the Type = "FR" AND either the open house date OR the Blue Chip date is less than or equal the AS OF DATE.

I am using the formula below and it will only add to the count if Open House date is <= the AS OF DATE.

{State} = "IL" AND {Type} = "FR" AND
((cdate({Open House}) <={?AS OF Date}) OR (cdate({Blue Chip}) <= {?AS OF Date}))
 
There is nothing obvious in the construction of the formula that would cause a problem.

For the RT to count the record, EITHER the {Open House} OR {Blue Chip} dates need to be prior to the {?AS OF Date}, as well as the State and Type matching. Is that what you want?

Are you saying there are records where the {State} = "IL", the {Type} = "FR" and the {Blue Chip} date is prior to the {?AS OF Date} that are NOT being counted?

Cheers
Pete
 
Yes. That is what is happening. If I change the order:
{State} = "IL" AND {Type} = "FR" AND
((cdate({Blue Chip}) <={?AS OF Date}) OR (cdate({Open House}) <= {?AS OF Date}))
I get the count of students with the Blue Chip date but not the Open House date.
 
It could be Nulls. See if this makes a difference: Go to File, Report Options, and check "Convert Database Nulls t Default Value" (may be slightly different wording in your version.
 
I made the change to the report options and ran into more problems. I am using a excel spreadsheet as my input table and it is creating many headaches! I think I will make a running total for the 'open house' and one for the 'Blue Chip' and add the two together at the end.

Thanks for the suggestions!
 
Then let's try it the hard way. Change it back and try this:

((not(isnull({Blue Chip})) and (cdate({Blue Chip})) <={?AS OF Date})
OR (not(isnull({Open House})) and (cdate({Open House}) <= {?AS OF Date})))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top