Customers including Credit Info
Last Modified on 18/07/2017 4:17 pm EDT
SELECT c.OrganisationV6 AS Company,
c.contactV6 AS Contact,
CASE
WHEN c.stop_credit = 0 THEN 'Allow Credit'
WHEN c.stop_credit = 1 THEN 'STOP CREDIT - DO NOT TRADE'
WHEN c.stop_credit = 2 THEN 'STOP CREDIT - Refer to Accounts'
ELSE 'Unknown'
END AS [Allow/Stop Credit],
P.PaytermName [Account Type],
c.PostalAddress1 AS [Address 1],
c.PostalAddress2 AS [Address 2],
c.PostalAddress3 AS [City/Town],
c.post_code AS [Postal Code],
c.StreetState AS [State/Province],
c.StreetCountry AS [Country]
FROM dbo.tblCust c
LEFT OUTER JOIN tblPayTermNames P ON c.Account_type = P.TermNo
WHERE (DisabledCust = 'N')