If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Access 2003 multiple if then statement help
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 |
#2
|
|||
|
|||
Access 2003 multiple if then statement help
On Wed, 25 Jul 2007 17:57:59 -0000, JAV wrote:
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] |
Thread Tools | |
Display Modes | |
|
|