Create new field in query using IIF function

AnnPhil

Registered User.
Local time
Today, 07:28
Joined
Dec 18, 2001
Messages
246
I tried to create a new field in a query using the IIF function but didn't get the results i wanted. The same IIf function works fine in my report but when i tried to do it in a query it wouldn't. Here is my iif function: IIf([Payee]="Beneficiary",[FullName],[Payee]).
If the payee is a beneficiary then i want to use the persons full name field, if not then i want to use the name in the Payee field. What is happening is if the Payee is = "Beneficiary" then it is still putting the name Beneficiary instead of the fullname!!!! I dont understand why because i can get this to work in a report. I need this to work in the query because i want to send the information to another program. So far all i can do is send a written report and then re-enter the data into the other program.

Thanks in advance for any help.
 
Just a quick clarification -

In your Payee field in the table, are you looking for the word "Beneficiary" or are you looking for a name?

Because right now, as it stands, you are telling your query to return the word "Beneficiary" if the payee value is not the word "Beneficiary."
 
Actually it is working fine now. I dont know why but i closed out and went back in later today and it works fine.
 

Users who are viewing this thread

Back
Top Bottom