Hi
I have written a query see below which kinda works out.
However, I also need to add to this code so I can get all records...
where stc.value = 'E - Single'
CON.AccountIdName is not equal to the companies listed in the query
and has null in their CON.AccountIdName field.
Any help is appreciated - I am really stuck on this one.
SELECT
CON.new_MembershipNumber,
CON.AccountIdName,
CON.FirstName,
CON.LastName,
STC.Value
FROM dbo.Contact CON
LEFT OUTER JOIN StringMap STC
ON STC.attributename = 'new_coveragetype'
AND STC.attributevalue = CON.new_CoverageType
AND STC.objecttypecode = 2
AND STC.langid = 1033
WHERE CON.StatusCode = 1
AND CON.AccountIdName != 'Company 1'
AND CON.AccountIdName != 'Company 2'
AND CON.AccountIdName != 'Company 3'
AND CON.AccountIdName != 'Company 4'
AND CON.AccountIdName != 'Company 5'
AND CON.AccountIdName != 'Company 6'
AND STC.Value = 'E - Single'
select 'the number of rows is:', @@rowcount