Sorry The Table is originally created from several tables
But thanks to your bit I have made some progress
using the following
SELECT dbo.Contact.Cntct_id,
Fax = Max(CASE WHEN dbo.ContactMethodType.CMT_Id = 1 Then dbo.ContactMethod.Cm_Entry Else Null End),
Email = Max(CASE WHEN...
The Sql I am attempting to use is
SELECT
Contact.Cntct_id,
Contact.Cntct_Title + ' ' + Contact.Cntct_First_Name + ' ' + Contact.Cntct_Last_Name
AS ContactName ,
(select ContactMethod.Cm_Entry
FROM ContactMethodType (NOLOCK) INNER JOIN
ContactMethod (NOLOCK) ON...
There is a single source table containing all the data
the customer Id may have up to 3 separate entries/records one for each contact type (phone/fax or email)
The use of the distinct only returns the first instance of a record for that customer
The result needs to be a cross tab of the results...
I have a table
Customer Id, Contact Type, Contact entry
the data is like this
cust 1 Phone 012345
cust 1 fax 54321
cust1 Email Someone@somewhare
Cust 2 Phone 23456
cust 2 fax 65432
cust 3 phone 34567
cust 3 Email cust@site
I want to create a view from...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.