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!

Can you get two different counts off the same field?

Status
Not open for further replies.

JoeyLeroy

Technical User
Aug 24, 2006
9
0
0
US
So I have this formula –

If {Query.Expr_1} in "P0000000" to "P0999999" Then
True

Else
False

Is there a way I can get a count of how many are true and how many are false off that one field?
 
Create 2 formula:
If {Query.Expr_1} in "P0000000" to "P0999999" Then
1
Else
0

If {Query.Expr_1} in "P0000000" to "P0999999" Then
0
Else
1

Then do summation on thse 2 formulas and that should give u count fo true and fasle values.
 
The above solution is OK, but your original formula could have been done much more simply, as {Query.Expr_1} in "P0000000" to "P0999999". This would be a booian and return True or False if displayed.

If the formula were called @InRange, you could then test from a pair of Running Totals, formulas @InRange and not @InRange. No better than techie2's solution, but worth knowing about.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top