Can I make a conditional (if then) expression in Access?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a calculated variable R. I want to build an expression in a query such
that another variable Rag = R unless R<7 in which case Rag=7. In other words,
If R<7 then Rag=7 else Rag=R. Is this possible ... I can't figure out how to
do it... thanks.
 
Thanks, it worked!

Allen Browne said:
See help on the Immediate If function:

=IIf([R] < 7, 7, [R])

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

aokhan said:
I have a calculated variable R. I want to build an expression in a query
such
that another variable Rag = R unless R<7 in which case Rag=7. In other
words,
If R<7 then Rag=7 else Rag=R. Is this possible ... I can't figure out how
to
do it... thanks.
 
Another issue I'm having is actually printing or copying an expression that
I've made. Do you know how to copy and/or print the formula in an expression?
The usually "copy" and "print" options are unavailable when I try.

Thanks,

Allen Browne said:
See help on the Immediate If function:

=IIf([R] < 7, 7, [R])

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

aokhan said:
I have a calculated variable R. I want to build an expression in a query
such
that another variable Rag = R unless R<7 in which case Rag=7. In other
words,
If R<7 then Rag=7 else Rag=R. Is this possible ... I can't figure out how
to
do it... thanks.
 
Presumably this is in the context of a query.

You can copy the field with Ctrl+C, and then paste into Notepad.

You can see the expression by pressing Shift+F2 to show the Zoom window.

You can see the entire SQL statement by choosing SQL View from the View
menu.
 

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

Back
Top