IIF

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

Guest

hello all

We have clients that we mail to, each client has a ID. However, they can
nominate another client as a representative who we mail instead. Therefore,
I need a query to use the Representative ID (if it exists), If there is no
Representative ID, to use Client ID.

My first effort doesnt work at all

Person:
IIf([tblClients.RepresentativeID]=True,IIf(([tblClients.RepresentativeID]=Null,[tblClients.ClientID]),([tblClients.RepresentativeID]=Null),[tblClients.RepresentativeID]))

And this 2nd effort doesnt give me a client ID if a representative ID exists.

Person:
IIf([tblClients.RepresentativeID]=True,IIf(([tblClients.RepresentativeID]=Null,([tblClients.RepresentativeID]=Null),[tblClients.RepresentativeID]))

Am I using the correct type of query?
 
Luke said:
hello all

We have clients that we mail to, each client has a ID. However, they
can nominate another client as a representative who we mail instead.
Therefore, I need a query to use the Representative ID (if it
exists), If there is no Representative ID, to use Client ID.

My first effort doesnt work at all

Person:
IIf([tblClients.RepresentativeID]=True,IIf(([tblClients.RepresentativeID]=Null,[tblClients.ClientID]),([tblClients.RepresentativeID]=Null),[tblClients.RepresentativeID]))

And this 2nd effort doesnt give me a client ID if a representative ID
exists.

Person:
IIf([tblClients.RepresentativeID]=True,IIf(([tblClients.RepresentativeID]=Null,([tblClients.RepresentativeID]=Null),[tblClients.RepresentativeID]))

Am I using the correct type of query?

Nz(RepresentativeID, ClientID)
 
Superb! many thanks!

Rick Brandt said:
Luke said:
hello all

We have clients that we mail to, each client has a ID. However, they
can nominate another client as a representative who we mail instead.
Therefore, I need a query to use the Representative ID (if it
exists), If there is no Representative ID, to use Client ID.

My first effort doesnt work at all

Person:
IIf([tblClients.RepresentativeID]=True,IIf(([tblClients.RepresentativeID]=Null,[tblClients.ClientID]),([tblClients.RepresentativeID]=Null),[tblClients.RepresentativeID]))

And this 2nd effort doesnt give me a client ID if a representative ID
exists.

Person:
IIf([tblClients.RepresentativeID]=True,IIf(([tblClients.RepresentativeID]=Null,([tblClients.RepresentativeID]=Null),[tblClients.RepresentativeID]))

Am I using the correct type of query?

Nz(RepresentativeID, ClientID)
 
Back
Top