Count function to add characters from multiple columns

Kasher

Registered User.
Local time
Today, 13:54
Joined
Dec 28, 2012
Messages
16
Hi, I want to add "H" from 3 columns into a total column in a query. couldn't be able to figure it out. for example, I ve one "H" in field1, and one "H" in field3 and field 2 is blank. I used this in query grid total:count([fileld1]+[field2]+[field3]), but it wont work only give 1 instead of 2. any help...
 
thanks for your reply. Well, after applying nz() function it is giving an error now. actually my fields are text data type. and i want to count fields only contain the character "H".
 
thanks for your help, i have done it like that. count(iif([field1]="H",0))+(count(iif([field2]="H",0)). and it is woking perfectly alright. there is one more problem, i have got 0.50 as a text in the same fields, how can i convert it into number after the count, actually it represents half day holiday. and H for full day holiday, any suggestion is much appreciated.
 
I have solve this issue with a help from Mr.Excel forum. it is as follow:

val(nz([field1],0))+val(nz([field2],0)) and so on....
 

Users who are viewing this thread

Back
Top Bottom