View Single Post
  #4  
Old April 27th, 2008, 07:39 AM posted to microsoft.public.access.forms
Steve Schapel
external usenet poster
 
Posts: 1,422
Default Count - if statement....

Learning_codes,

As I said before, I am puzzled why you are using "Like", it doesn't make
sense.

Are you puttting this stuff into your posts here by copy/paste, or are
you re-typing? Copy/paste is best, so we can try to diagnise exactly
what you are working with.

These expressions have incorrect syntax. There is no closing ")" for
one of the IIf() functions, and also no "false part" argument for the
IIf(). Also, a string closure " was missing, and there is a space
between the Count and the "(".

As far as I can work out, I think you want this:
="Completed: " & IIf([GroupA]="Product A",Sum(IIf([Answer]="1",1,0)) & "
of " & Count(*),0)

--
Steve Schapel, Microsoft Access MVP

wrote:

Thanks for getting back to me. My mistake.. it should be like this
but still not able to get the count.

="Completed: IIf([GroupA] like "Product A",Sum(IIf([Answer] like "1",
1,0)) & " of " & Count (*)
="Completed: IIf([GroupB] like "Product B",Sum(IIf([Answer] like "1",
1,0)) & " of " & Count (*)