Access 2003 multiple if then statement help

J

JAV

Hello,

I am having a problem constructing the proper clause for querying my
database. I have multiple values used in computing daily averages of
constituent data for measurements. An example of my table for my table
[tbl_data] is shown below;

Constit Value AdjConstitValue UseIterpolated DoNotUse
S1 1300 1258
[x] [ ]
S1 1352
[ ] [ ]
S1 1564
[ ] [x]
etc..

Using an if statement I put together a statement for the query to
display the AdjConstitValue if UseInterpolated is checked and that
works fine. My problem is how to integrate the DoNotUse into the IIF
statement I attempted to use Or in conjunction with another IIF
statement but that was to no avail. What happens is the query returns
all values as being -1? If DoNotUse is checked then the value should
be disregarded in the average calculation. Please give me any input
you may have on this. It is driving me nuts. I can get one or the
other to work but not both at once. Thanks in advance for any
comments.

Jon V
 
J

John W. Vinson

Hello,

I am having a problem constructing the proper clause for querying my
database. I have multiple values used in computing daily averages of
constituent data for measurements. An example of my table for my table
[tbl_data] is shown below;

Constit Value AdjConstitValue UseIterpolated DoNotUse
S1 1300 1258
[x] [ ]
S1 1352
[ ] [ ]
S1 1564
[ ] [x]
etc..

Using an if statement I put together a statement for the query to
display the AdjConstitValue if UseInterpolated is checked and that
works fine. My problem is how to integrate the DoNotUse into the IIF
statement I attempted to use Or in conjunction with another IIF
statement but that was to no avail. What happens is the query returns
all values as being -1? If DoNotUse is checked then the value should
be disregarded in the average calculation. Please give me any input
you may have on this. It is driving me nuts. I can get one or the
other to work but not both at once. Thanks in advance for any
comments.

Jon V

This got word-wrapped into incomprehensiblity, and it's not clear what field
is what. You might also want to post the actual query you're using in SQL
view.

If you don't want DoNotUse records included in the average, can you simply use
a criterion of False on the query so that the record isn't retrieved at all?

John W. Vinson [MVP]
 

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