I am trying to run a query which will return specific values in a table as they currently currently are i.e internal departments (i.t, sales, procurement, marketing etc) but return all other values as one value i.e all external users (bob, nick, harry etc) as External.
I think that i may need to use the IIF function. However i cant get it to run as it says that there is a "syntax error in From clause"
here is my query
SELECT * INTO zztemp3
FROM zzztemp2
IIf ([zzztemp2.deptname]="Admin","Admin",IIF ([zzztemp2.deptname]="Information systems","Infromation systems,IIF ([zzztemp2.deptname]="Administration","Administraton",IIF ([zzztemp2.deptname]="Audit &","Audit &",IIF ([zzztemp2.deptname]="Corporate","Corporate",IIF ([zzztemp2.deptname]="Customer Services","Customer Services,IIF ([zzztemp2.deptname]="Finance","Finance",IIF ([zzztemp2.deptname]= "Health & Safety","Health & Safety,IIF ( [zzztemp2.deptname]="Home delivery team","Home Delivery Team",IIF ([zzztemp2.deptname]="HR","HR",IIF ([zzztemp2.deptname]="Human Resources","Human Resources",IIF ([zzztemp2.deptname]="I.T.","I.T.", IIF ([zzztemp2.deptname]= "Information Technology","Information Technology",IIF ([zzztemp2.deptname]="Inventory","Inventory",IIF ([zzztemp2.deptname]="Operations","Operations",IIF ([zzztemp2.deptname]="PA's Office", "PA'S Office",IIF ([zzztemp2.deptname]="Procurement","Procurement",IIF ([zzztemp2.deptname]="Receipts","Receipts",IIF ([zzztemp2.deptname]="Sales","Sales",IIF ([zzztemp2.deptname]="Stock management","Stock management", IIF ([zzztemp2.deptname]="Stock Audit","Stock Audit",IIF ([zzztemp2.deptname]="Supply chain services","Supply chain services",IIF ([zzztemp2.deptname]="Transport","Transport",IIF ([zzztemp2.deptname]="warehouse","warehouse","External"))))))))))))))) )))));
Please Help