Hello all,
I have been asked to modify this query and add the vendor name to it, the only problem is that when I put it into SSMS to work with it
I get the error of incorrect sytntax near the keyword as and when I take out ass I get an incorrect syntax near the key word 'from'
any help would be great as I am fighting a sinus infection and can barely hold my head up.
I have been asked to modify this query and add the vendor name to it, the only problem is that when I put it into SSMS to work with it
I get the error of incorrect sytntax near the keyword as and when I take out ass I get an incorrect syntax near the key word 'from'
any help would be great as I am fighting a sinus infection and can barely hold my head up.
Code:
select top 100
i.Item,
i.Description,
i.SPC,
(select isnull(sum(invl.Quantity), 0) from ARInvoiceLine invl
where invl.Item = i.Item and invl.DateAdded >= '01/01/2014' and invl.DateAdded <'12/30/2016'
+
(select isnull(sum(invlc.Quantity), 0) from ARInvoiceLineComponent invlc
where invlc.Item = i.Item and invlc.DateAdded >= '01/01/2014' and invlc.DateAdded < '12/30/2016' as 'Qty Sold'
from IMItem i
where i.SPC like @SPC
order by 'Qty Sold' desc, i.Item