IIf statement that formats text?

JackieEVSC

Registered User.
Local time
Today, 14:43
Joined
Feb 24, 2012
Messages
26
I have a query that parses out apostrophe's in student names. In some instances, there is no student name. When that happens, the results are "#Error" for both FirstName and LastName. (Because I'm forcing the field to be included by way of joins).

The formatting for that field works unless there is no value ... LName: Replace([LastName],"'","").

If there is no name, I need the LastName field to pull in "Inventory", and the FirstName field be blank. If there is a name, I need to remove all apostrophe's from it.

Is it possible to do this with an IIf statement in a query?

Thanks in advance for any help you can give me!
 
Try

Replace(Nz([LastName], "Inventory"),"'","")
 

Users who are viewing this thread

Back
Top Bottom