Show every customer even if mobile in null

S

Simon

I have the following query that shows mobile number for any customer

Is there a way it to dispay ever customer number and if the customer
does not have a mobile number its left black

SELECT tblCustomers.CustomerNumber, Replace([PhoneNumber], " ", "") AS
Mobile
FROM tblCustomers
WHERE [PhoneNumber] LIKE "07*"

Union
SELECT tblCustomers.CustomerNumber, Replace([MobileNumber], " ", "")
AS Mobile
FROM tblCustomers
WHERE [MobileNumber] LIKE "07*"
 
A

Arvin Meyer [MVP]

How about:

SELECT tblCustomers.CustomerNumber, Replace([PhoneNumber], " ", "") AS
Mobile
FROM tblCustomers
WHERE [PhoneNumber] LIKE "07*";
UNION
SELECT tblCustomers.CustomerNumber, Replace([MobileNumber], " ", "") AS
Mobile
FROM tblCustomers;
 
K

KARL DEWEY

Maybe like this --
SELECT tblCustomers.CustomerNumber, IIF([MobileNumber] LIKE "07*",
Replace([MobileNumber], " ", ""), Replace([PhoneNumber], " ", "") AS Mobile
FROM tblCustomers;

Build a little, test a little.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top