How do I run a query using multiple conditions?

C

CTW95

I am trying to run a query using an "If then" type statement. Basically, I
have created a Make Table query to calculate sums of variables from a
questionnaire (I need these sums stored, so this is why I made a table);
however, sometimes the questionnaires are not completed and I needed to
create a default value to show the missing data. I want to generate a report
of this data and I only want to show the records with real data. Thus, I
need a query that will show the word "Invalid" if the value of that summary
score is greater than a certain number. If the value is not greater than
that target number, I want to sum of the variable to be displayed. Is this
possible? I have tried the following expression in the Criteria line with no
luck (I get a data mismatch error):

=IIF(>155, "Invalid", [BPtotb] - [BPtota])

Any suggestions for how to accomplish this?

Thanks!
CTW
 
P

Piet Linden

I am trying to run a query using an "If then" type statement.  Basically, I
have created a Make Table query to calculate sums of variables from a
questionnaire (I need these sums stored, so this is why I made a table);
however, sometimes the questionnaires are not completed and I needed to
create a default value to show the missing data. I want to generate a report
of this data and I only want to show the records with real data.  Thus,I
need a query that will show the word "Invalid" if the value of that summary
score is greater than a certain number.  If the value is not greater than
that target number, I want to sum of the variable to be displayed.  Is this
possible?  I have tried the following expression in the Criteria line with no
luck (I get a data mismatch error):

=IIF(>155, "Invalid", [BPtotb] - [BPtota])

Any suggestions for how to accomplish this?

Thanks!
CTW

Use NZ()

IIF([FieldName]>155,"Invalid", [BPtotb] - [BPtota])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top