1. ## Count (2002 SP-2)

In a txtbx located in the footer of a continuous form:
=Count(IIf([txtCarrierName] Like "ABC*",[txtCarrierName],0))
is returning all records, rather than those like "ABC*"

2. ## Re: Count (2002 SP-2)

=Count(IIf([txtCarrierName] Like "ABC*",[txtCarrierName],0))
you could use sum :
=Sum(IIf([txtCarrierName] Like "ABC*",1,0))

3. ## Re: Count (2002 SP-2)

Left to my own devices usually results in further catastrophy, however:
=DCount("[txtCarrierName]","qfltMasterAllFiltered","[txtCarrierName]Like'ABC*'")
. . .works just fine.
(he said to himself) <img src=/S/bingo.gif border=0 alt=bingo width=15 height=22>

4. ## Re: Count (2002 SP-2)

Francois:

Nice to hear from you again. Our posts just passed in cyberworld. Your solution also works, and is cleaner than mine. Thanks!

5. ## Re: Count (2002 SP-2)

Francois:

If you don't mind, what does the " 1 " represent?
=Sum(IIf([txtCarrierName] Like "ABC*",1,0))

6. ## Re: Count (2002 SP-2)

If the Like "ABC*" is true, then sum add 1 to the total. If False then sum add 0 to the total.

7. ## Re: Count (2002 SP-2)

<img src=/S/dizzy.gif border=0 alt=dizzy width=15 height=15>
add 1 to the total? You don't mean the total + 1? Sorry, not getting it.

8. ## Re: Count (2002 SP-2)

if for a record the condition is true then the result of the iif condition is 1
if for a record the condition is false then the result of the iif condition is 0
Then it sum all then 1 and 0

Hope I made it clear now. If not, post again, but I have to leave now and I will answer later.

9. ## Re: Count (2002 SP-2)

Francois:

I got it! <img src=/S/blush.gif border=0 alt=blush width=15 height=15>
Thanks.

#### Posting Permissions

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