Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sum of a few boolean fields in a query 1

Status
Not open for further replies.

jamaarneen

Programmer
Dec 27, 2007
212
BE

Hi

In my table I have some boolean fields. I would like to create a column in a query, that tells me if there is at least one of the booleans fields that are 'true'.

I tried to write (in query design view) somthing like that:
Code:
NewColumnName:= IIf ( ([blField_1]) = -1) Or [blField_2] = -1) Or( [blField_3] = -1)  ; 1;0

I also tried:
Code:
NewColumnName:= IIf ( ([blField_1]) = true) Or [blField_2] = true) Or( [blField_3] = true)  ;true;false

but non of these were accepted

I would prefer to get the result as a boolean, but an integer would also be OK.

Thanks for trying to help...

 
Why not simply this ?
NewColumnName: blField_1 Or blField_2 Or blField_3

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 

Great, PHV. As always.

It gives -1 / 0, but it will do it
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top