Calculated field quiries

Buffy

New Member
Joined
Nov 25, 2002
Messages
13
Hey,
I wondered if you could help with a calculation query problem I have. I would like to use a calculation query with an IF function. So that if a field which I have, which has a yes/no data type, is not checked the calculation takes into account the value that field has for that particular record. The calculation only requires the value to be added to another value.
Thanks.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
This doesn't sound too hard - can you give an example of your data, and an example of what you'd like to see?

Thank you!
 
Upvote 0
I would like to use a calculation query with an IF function.
For "if" in Access, use IIF.
So that if a field which I have, which has a yes/no data type, is not checked the calculation takes into account the value that field has for that particular record.
Could you clarify, it sounds like you're saying you want to add the value from a True/False field depending on whether or not the field in T/F. Do you mean add the value -1 for true, and nothing for false. That's the only values you're going to get from a true/false field. If you're saying you want to add the value from field1, depending on whether or not field2 is T/F, that would make a little more sense. In the blank for a new field with your query in design view, add something like:<pre>Expr1: IIf([T/F]=-1,[Field1]+[Field2],[Field1])</pre>
This would add Field1 and Field2 if the T/F field had 'T' checked.

edit:
and only display [Field1] if 'F' is checked.

HTH,
Corticus
This message was edited by Corticus on 2002-12-18 10:44
 
Upvote 0

Forum statistics

Threads
1,221,499
Messages
6,160,164
Members
451,628
Latest member
Bale626

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top