Combing data from 4 columns into 1

  • Thread starter Thread starter Joey
  • Start date Start date
J

Joey

Hello all,

I would like to combine Phone numbers from a fax, home, work and mobile
fields all into 1 column to populate a list of all the phone numbers.
It seems something like this should be really simple but I'm having
trouble finding out how to do this. Much appreciated.

Thanks,
Joey.
 
Hello all,

I would like to combine Phone numbers from a fax, home, work and mobile
fields all into 1 column to populate a list of all the phone numbers.
It seems something like this should be really simple but I'm having
trouble finding out how to do this. Much appreciated.

Thanks,
Joey.

If you want to get a sequential list with one phone number per record
(which I'd advise), a UNION query would be the ticket. You need to go
into the SQL window to do this:


SELECT [Fax] AS [Phone] FROM [yourtable] WHERE [Fax] IS NOT NULL
UNION ALL
SELECT [Home] AS [Phone] FROM [yourtable] WHERE [Home] IS NOT NULL
UNION ALL
SELECT [Work] AS [Phone] FROM [yourtable] WHERE [Work] IS NOT NULL
UNION ALL
SELECT [Cell] AS [Phone] FROM [yourtable] WHERE [Cell] IS NOT NULL;


John W. Vinson[MVP]
 
Joey said:
Hello all,

I would like to combine Phone numbers from a fax, home, work and mobile
fields all into 1 column to populate a list of all the phone numbers.
It seems something like this should be really simple but I'm having
trouble finding out how to do this. Much appreciated.

Thanks,
Joey.


Air Code:

SELECT FaxPhone & HomePhone & WorkPhone & MobilePhone
FROM MyNonNormalizedPhoneNumbers


Sincerely,

Chris O.
 
Back
Top