Simple query

morlan

Registered User.
Local time
Today, 19:34
Joined
Apr 23, 2003
Messages
143
Morning all, happy Chinese New Year,

Here's my table:

tblMain


A - B
1 - 0
1 - 1
0 - 1
0 - 0

If there is a 1 in either field I want a query to return 1 in field C.
If a 0 in both fields then it should return 0. Is this simple enough?

qryMain


A - B - C
1 - 0 - 1
1 - 1 - 1
0 - 1 - 1
0 - 0 - 0
 
NewField: IIf([Field1]=1,1,IIf([Field2]=1,0))
 
Gung hay fat choy dudes.

How about an alternative?
MyField: IIf([Field1] Or [Field2],1,0)
 
lol, I've always approached that like the OR in Excel - totally different. No wonder it's never worked for me....:rolleyes:
 
I like the Or (and And) function in Excel better. It's more concise. :D
 
Great, thanks guys. Got this sorted with your help. :)
 

Users who are viewing this thread

Back
Top Bottom