If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Count - if statement....
Hi,
I created a box called TXT_Completed for me to put ="Completed: " & Sum(IIf([Answer] like "1",1,0)) & " of " & Count (*) and it works. I have four groups and I want to set like below and I'm not able to make it work. ="Completed: IIf([GroupA] like "1",1,0)) & " of " & Count (*) and next one, ="Completed: IIf([GroupB] like "1",1,0)) & " of " & Count (*) I'm struggling last two A and B. Your help would be much appreciated. I don't know if I do the right thing. Thanks |
#2
|
|||
|
|||
Count - if statement....
Learning_codes,
The syntax of the one that works and the one that doesn't are different. Also, the use of the "Like" keyword here is not necessary, apparently, as you have no wildcard. Therefore, try: ="Completed: " & Sum(IIf([GroupA]="1",1,0)) & " of " & Count (*) If I have misunderstood, perhaps you can give some more details of where these textboxes are located, and what is the meaning of the fields such as Answer and GroupA and GroupB and what is the relationship between them. -- Steve Schapel, Microsoft Access MVP wrote: Hi, I created a box called TXT_Completed for me to put ="Completed: " & Sum(IIf([Answer] like "1",1,0)) & " of " & Count (*) and it works. I have four groups and I want to set like below and I'm not able to make it work. ="Completed: IIf([GroupA] like "1",1,0)) & " of " & Count (*) and next one, ="Completed: IIf([GroupB] like "1",1,0)) & " of " & Count (*) I'm struggling last two A and B. Your help would be much appreciated. I don't know if I do the right thing. Thanks |
#3
|
|||
|
|||
Count - if statement....
On Apr 26, 6:47*pm, Steve Schapel wrote:
Learning_codes, The syntax of the one that works and the one that doesn't are different. Also, the use of the "Like" keyword here is not necessary, apparently, as you have no wildcard. Therefore, try: ="Completed: " & Sum(IIf([GroupA]="1",1,0)) & " of " & Count (*) If I have misunderstood, perhaps you can give some more details of where these textboxes are located, and what is the meaning of the fields such as Answer and GroupA and GroupB and what is the relationship between them. -- Steve Schapel, Microsoft Access MVP wrote: Hi, I created a box called *TXT_Completed for me to put ="Completed: " & Sum(IIf([Answer] like "1",1,0)) & " of " & Count (*) *and it works. I have four groups and I want to set like below and I'm not able to make it work. ="Completed: IIf([GroupA] like "1",1,0)) & " of " & Count (*) and next one, ="Completed: IIf([GroupB] like "1",1,0)) & " of " & Count (*) I'm struggling last two A and B. * Your help would be much appreciated. *I don't know if I do the right thing. Thanks- Hide quoted text - - Show quoted text - 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 (*) |
#4
|
|||
|
|||
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 (*) |
Thread Tools | |
Display Modes | |
|
|