Michael J Ross
Registered User.
- Local time
- Today, 04:49
- Joined
- Mar 2, 2006
- Messages
- 245
Im currently trying to create a field that strips plc and ltd suffixes from vendor names, and if theyre not there just return the name. I've tried the following which works fine for those records where plc or ltd exists in the name, but where it doesnt it's returning error.
Can anyone point where i'm going wrong?
Thanks
SELECT IIf(InStr([organization_operating_name],"ltd")>0,Replace([organization_operating_name],"ltd",""),IIf(InStr([organization_operating_name],"plc">0,Replace([organization_operating_name],"plc","")),[organization_operating_name])) AS OrgName, VendorsPdinLastYr.vendor_id
FROM VendorsPdinLastYr;
Can anyone point where i'm going wrong?
Thanks