I am trying to perform Select If in MSSQL in Access, not having any success. All I want to do is have 2 columns with addresses, pick the one that is not blank to use.
Name: Short text
Address: Short text
BillingAddress: Short text
The data will have either Address or BillingAddress filled, and I want to create mailing labels.
I tried to write SELECT IF ( Address != "", Address, BillingAddress) As LabelAddress From MyTable and getting syntax error, I am not sure if MSSQL support SELECT IF.
How could I accomplish this in Access? Do I need to create VBA module?
I am not able to get the syntax right. I want to use either Address or Billing_Addr which ever is not blank. What am I doing wrong?
SELECT IIF (Clients.[Address] != "", Clients.[Address], Clients.[Billing_Addr])