Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
select case when ASC_BR.dbo.MthEndInvtDivVend.Division between 10 and 19 then '10' when ASC_BR.dbo.MthEndInvtDivVend.Division between 20 and 29 then '20' when ASC_BR.dbo.MthEndInvtDivVend.Division between 30 and 39 then '30' when ASC_BR.dbo.MthEndInvtDivVend.Division between 40 and 49 then '40' when ASC_BR.dbo.MthEndInvtDivVend.Division between 50 and 59 then '50' else ASC_BR.dbo.MthEndInvtDivVend.Division end as divi, ASC_BR.dbo.VENDOR.Name, ASC_BR.dbo.MthEndInvtDivVend.VendorNum, round(abs(sum(ASC_BR.dbo.mthendSalesDivVend.SalesRtl)/AVG(nullif(invcost,0))),2) as turn, round(AVG(NULLIF(ASC_BR.dbo.MthEndInvtDivVend.InvCost,0)),0) as InvCost, SUM(ASC_BR.dbo.mthendSalesDivVend.SalesRtl) as SalesRtl, SUM(ASC_BR.dbo.mthendSalesDivVend.SalesCost) as SalesCost, avg(nullif(ASC_BR.dbo.MthEndInvtDivVend.OHQty,0)) as QtyOH, sum(ASC_BR.dbo.mthendSalesDivVend.SalesQty) as SlsQty, sum(salesrtl)-sum(salescost) as GM$, round((sum(salesrtl)-sum(salescost))/nullif(sum(salesrtl),0)*100,2) from ASC_BR.dbo.MTHENDINVTDIVVEND left outer join ASC_BR.dbo.VENDOR on ASC_BR.dbo.VENDOR.VendorNum=ASC_BR.dbo.MTHENDINVTDIVVEND.Vendornum left outer join ASC_BR.dbo.MthEndSalesDivVend on ASC_BR.dbo.mthendSalesDivVend.Division=ASC_BR.dbo.MTHENDINVTDIVVEND.Division and ASC_BR.dbo.mthendSalesDivVend.VendorNum=ASC_BR.dbo.MTHENDINVTDIVVEND.VendorNum and ASC_BR.dbo.mthendSalesDivVend.YearMth=ASC_BR.dbo.MTHENDINVTDIVVEND.YearMth where left(ASC_BR.dbo.MTHENDINVTDIVVEND.Division,1) in ('1','2','3','4','5','6') and asc_br.dbo.MTHENDINVTDIVVEND.YearMth>=convert(char(4),year(DATEADD(month,-12,GETDATE())))+right('00'+convert(varchar(2),month(DATEADD(month,-12,GETDATE()))),2) and asc_br.dbo.MTHENDINVTDIVVEND.YearMth<=convert(char(4),year(DATEADD(month,0,GETDATE())))+right('00'+convert(varchar(2),month(DATEADD(month,-1,GETDATE()))),2) group by divi,ASC_BR.dbo.MTHENDINVTDIVVEND.Vendornum,ASC_BR.dbo.VENDOR.Name order by Name,divi
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|SQL select to return records that don't exist (crosjoin?)||3||40|
|EF5 How do I stop pre-compiled views?||8||51|
|CASE Statement using different fields||8||26|
|Windows Server 2003 STD SP2 as a member server of 2016 domain||11||91|
Join the community of 500,000 technology professionals and ask your questions.