problem with check box and equations

qurn

Registered User.
Local time
Today, 12:22
Joined
May 2, 2005
Messages
63
I have a simple problem that I can’t seem find any help for. I’ve tried searching and browsing the forums with no luck. I have a Boolean (yes/no) column that I would like to be dependent on an equation containing fields in a table. The equation is simple: I have three columns I’ll call them A, B and H.

The Equation is: A*12+B<H

If it’s true then the field will equal yes, if the equation is false then the field equals no.

I’d like to have this in a query that I can base a report off of. I know very little about SQL or VBA so when I see SQL or VBA terms used I can’t always tell what they mean. So if someone could tell me what I need to do I’d also know where to put it. Thanks A bunch!
 
i think you can put something like this
iif(a*12+b<h,Yes,No)
in the criteria of that Y/N field in the query design page
 
naw, sorry that's not working,thanks anyway.
 
The syntax is OK but a couple of brackets are missing.
Code:
iif((a*12+b)<h,Yes,No)
However, that's not the whole story. This should either be used to create a calculated field in your query or be part of an update query, not a criterion in a select query.

Strictly, speaking, if you can calculate the boolean value, you shouldn't be storing it anyway. You should always calculate it.
 
Last edited:
Thank's That works, but unfortunatly I need to have it shown as yes/no or check box because thats what my boss expects. Even though if you do the equation you could tell the answer just by looking at it.

on a side note what is your avatar of neileg, I can never make it out.
 
Neil's avitar is Andy Capp from the funny papers, comic strips!
 
qurn said:
Thank's That works, but unfortunatly I need to have it shown as yes/no or check box because thats what my boss expects. Even though if you do the equation you could tell the answer just by looking at it.

on a side note what is your avatar of neileg, I can never make it out.
I think that if you bind a form to the query you can have the calculated yes/no field as a check box.

If your boss expects to see the data in a table and not in a form, then you need to upgrade to Boss 2.05 which has this bug fixed.

As RuralGuy said, the avatar is Andy Capp. He is a caricature of men from the North East of England, which is where I'm from.
 

Users who are viewing this thread

Back
Top Bottom