Results 1 to 9 of 9
  1. #1
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    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*"
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Count (2002 SP-2)

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

  3. #3
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    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>
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  4. #4
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    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!
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  5. #5
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Count (2002 SP-2)

    Francois:

    If you don't mind, what does the " 1 " represent?
    =Sum(IIf([txtCarrierName] Like "ABC*",1,0))
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.
    Francois

  7. #7
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    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.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  8. #8
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.
    Francois

  9. #9
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Count (2002 SP-2)

    Francois:

    I got it! <img src=/S/blush.gif border=0 alt=blush width=15 height=15>
    Thanks.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

Posting Permissions

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