A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Access 2003 multiple if then statement help



 
 
Thread Tools Display Modes
  #1  
Old July 25th, 2007, 06:57 PM posted to microsoft.public.access.queries
JAV
external usenet poster
 
Posts: 3
Default 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  
Old July 27th, 2007, 05:52 AM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.