I have a query with an IIf statement which makes some calculations for the user, based on values other places in the query. The IIF statement returns a piece of text which the user can read.
So far, this works just fine.
Now, I have two problems which I seek to solve in a certain way.
First, the IIF statement becomes very long. Second, I would like to format the returned text string.
I believe the solution to both may be to have the IIf statement return a value from another table. In this other table, I can make long text strings and I can format them too, without the IIf statement becoming very long.
But, how do I ask the IIf statement to return a value which is placed in a table?
Has it something to do with lookup, and how do I use that?
Thank you in advance.
EDIT: Thought I'd add information about the value I'm trying to have the IIf statement return.
Let's say I have a table called Table1. In Table1, there are two columns, Id and Returntext. There are a number of rows, with Id going from 1 to 5, and Returntext having the needed information.
I am trying to create an IIf statement where the returned value (if statement is true) is Returntext, corresponding to a patricular Id. For instance, if the IIf statement is TRUE, then return the text in Returntext corresponding to Id=1, and if the IIf statement is FALSE, then return the text in Returntext corresponding to Id=2.