SELECT top 25
sh.No_,
sh.[Sell-to Customer No_],
sh.[Bill-to Name],
sh.[Due Date],
sh.[Salesperson Code],
sh.[Document Date],
sh.[Expiration Date],
sh.[Quoted By],
sh.[Status],
c.[E-Mail]
FROM
[AB50LIVE].[dbo].[AB Live$Sales Header] AS sh
INNER JOIN dbo.[AB Live$Customer] AS c ON sh.[Sell-to Customer No_]=c.[No_]
Where
c.[E-Mail] <> ' '
and sh.[Due Date] between GETDATE()-7 and GETDATE()
|