There are about 3 phone fields in my table:
WorkPhone = WorkAreaCode + WorkPhone + WorkExtension
MobilePhone = MobileAreaCode + MobilePhone
HomePhone = HomeAreaCode + HomePhone
This is what I had so far...but this statement only displays information if WorkAreaCode,WorkPhone,WorkExtension, MobileAreaCode, MobilePhone, HomeAreaCode, HomePhone are ALL populated.
I want to display phone information...regardless of the fact that there might not be data in the workareacode field or mobileareacode field or any other field. Any help is apprecisted...Thanks in advance.
SELECT CASE WHEN EmpData.WorkPhone IS NOT NULL
THEN 'Work: (' + EmpData.WorkAreaCode + ') ' + EmpData.WorkPhone + ' Ext: ' + EmpData.WorkExtension + CHAR(13) + CHAR(10)
ELSE ''
END +
CASE WHEN EmpData.MobilePhone IS NOT NULL
THEN 'Mobile: (' + EmpData.MobileAreaCode + ') ' + EmpData.MobilePhone + CHAR(13) + CHAR(10)
ELSE ''
END +
CASE WHEN EmpData.HomePhone IS NOT NULL
THEN 'Home: (' + EmpData.HomeAreaCode + ') ' + EmpData.HomePhone + CHAR(13) + CHAR(10)
ELSE ''
END AS Phones
From EmpData
WorkPhone = WorkAreaCode + WorkPhone + WorkExtension
MobilePhone = MobileAreaCode + MobilePhone
HomePhone = HomeAreaCode + HomePhone
This is what I had so far...but this statement only displays information if WorkAreaCode,WorkPhone,WorkExtension, MobileAreaCode, MobilePhone, HomeAreaCode, HomePhone are ALL populated.
I want to display phone information...regardless of the fact that there might not be data in the workareacode field or mobileareacode field or any other field. Any help is apprecisted...Thanks in advance.
SELECT CASE WHEN EmpData.WorkPhone IS NOT NULL
THEN 'Work: (' + EmpData.WorkAreaCode + ') ' + EmpData.WorkPhone + ' Ext: ' + EmpData.WorkExtension + CHAR(13) + CHAR(10)
ELSE ''
END +
CASE WHEN EmpData.MobilePhone IS NOT NULL
THEN 'Mobile: (' + EmpData.MobileAreaCode + ') ' + EmpData.MobilePhone + CHAR(13) + CHAR(10)
ELSE ''
END +
CASE WHEN EmpData.HomePhone IS NOT NULL
THEN 'Home: (' + EmpData.HomeAreaCode + ') ' + EmpData.HomePhone + CHAR(13) + CHAR(10)
ELSE ''
END AS Phones
From EmpData