Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculating Fields - Yes or No Outcome?

Status
Not open for further replies.

Tezdread

Technical User
Oct 23, 2000
468
GB
I need to convert a few excel formulas into access queries and was hoping for some advise. :)

one of the simpler ones is like this

If all these fields meet the specified criteria the outcome is Yes otherwise No

field1 | Field2 | Field3 | Feild4
>= "2" | = "Y" | > "3" | <= "3"

When the data is entered into the form fields, another text box would show the outcome once all fields are completed (Yes or No)

Where's the best place to start?

Tezdread
&quot;With every solution comes a new problem&quot;
 
Take a look at the IIf function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
iif([field1]>=2 and [Field2] = "Y" and [Field3] > 3 and [Field4] <= 3, "Yes", "No")

traingamer
 
ummm.....guess I'm missing some funamental information that I can't find in the help.

I see the example and how it works now but where does it go :) ?

I tried it in SQL view but that didn't work and when i try different combinations in design view I can't seem to get it right eihther.

I've tried it in the Control Source of a text field on a form connected to the right table but still nothing?

Tezdread
&quot;With every solution comes a new problem&quot;
 
You can use it in a query as an expression YNFlag: iif([field1]>=2 and [Field2] = "Y" and [Field3] > 3 and [Field4] <= 3, "Yes", "No")
then use YNFlag in your form or you can do it a number of other ways programmatically.

traingamer
 
still not getting there....I've done a search in help on YNFlag and it doesn't show anything, I tried putting it in a query, criteria but that didn't work either....

I'm not asking for a step by step guide but I just can't find anything in the help to point me in the right direction?

Tezdread
&quot;With every solution comes a new problem&quot;
 
still not getting there....I've done a search in help on YNFlag and it doesn't show anything, I tried putting it in a query, criteria but that didn't work either....

I'm not asking for a step by step guide but I just can't find anything in the help to point me in the right direction?

Tezdread
&quot;With every solution comes a new problem&quot;
 
In the field cell of a new column in the query grid, you type something like this:
YNFlag: IIf([field1]>=2 And [Field2]="Y" And [Field3]>3 And [Field4]<=3, "Yes", "No")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
finally got it to work...thanks
Is there anywhere I can find info on YNFlag? I did a search on google and couldn't fine anything there either? Guess it's not a common function

Tezdread
&quot;With every solution comes a new problem&quot;
 
finally got it to work...thanks
I think the penny just dropped as well....I was looking for information on the YNFlag thinking that this was a function of some sort but now I see it working it just looks like the name of the field the new Y/N value is stored.

Tezdread
&quot;With every solution comes a new problem&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top