October 31, 2015 at 12:40 am
Hi,
Despite the products are different, I want to get the sum of all products according to customer card.(client ref)
select (ORF.PRICE) *( ORF.AMOUNT - ORF.SHIPPEDAMOUNT) from [.dbo.LG_032_01_ORFLINE ORF JOIN [.dbo.LG_32_01_ITEMS ITM ON ORF.STOCKREF = ITM.LOGICALREF where ORF.CLIENTREF = XXX
October 31, 2015 at 8:41 am
Generally speaking, the SUM function is what's used to get the sum of a set of numbers.
What you're asking doesn't sound too difficult, but we need more to go on. To offer any real advice, we're going to need some consumable DDL and sample data, along with your expected output. Take a look at the third link in my signature for information how to best ask a question.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply