Creating a query where a field not in table needed

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

Guest

Opened the query in design view. I have created a new field, the value of
which is calculated from other fields. I have to use and "If"/"Iif"
statement. I want it to be "If value in field NOT equal to this value, do
this..."
I am having problems with the NOT bit. What do I type? And please be simple
with me :)
 
Mandorallin said:
Opened the query in design view. I have created a new field, the value of
which is calculated from other fields. I have to use and "If"/"Iif"
statement. I want it to be "If value in field NOT equal to this value, do
this..."
I am having problems with the NOT bit. What do I type? And please be simple
with me :)


CREATE TABLE YourTable
(Column1 TEXT(10)
,Column2 LONG
)

SELECT Y1.Column1
,Y1.Column2
,IIF(Y1.Column1 = "Your Data", "True", "False")
,IIF(Y1.Column2 = 10, 56, 24)
FROM YourTable AS Y1

IIF Syntax:

IIF(<expression>, <return value if true>, <return value if false>)


Sincerely,

Chris O.
 
Back
Top