SELECT
T.CustAcct,
T.CustomerName,
T.Address1,
T.Address2,
T.City,
T.State,
T.Zip,T3.YTDTotSales,
T3.YTDPubProfit
T1.FirstName As SalesContactFirstName,
T1.LastName As SalesContactLastName,
T1.EmailAddress,
T2.SmanCode As SmanCode,
FROM arcusts T
Left Outer Join arcconts T1 On T.SalesContactID = T1.CustContactID
Left Outer Join arsmen T2 On T.SmanID = T2.SmanID
Left Outer Join arcsales T3 On T.CustID = T3.CustID
WHERE T3.FiscalYear=2012
and T2.SmanCode='Salesman1'
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
if you find them, what do you want to do?
you can use
and some_column is null
in the where clause or join conditions if you want to look for nulls
or something like
isnull(t.custacct,' null account') as custacct,
to replace nulls with a value in the select