Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Query help needed

$
0
0

Hi I have a requirement and I am not sure how to go about it.

I have a Shipment query

Datatypes

ticketnum varchar(10)

,POnum int

,Ext_Price float,

qty int

,shipping Int

,sale_price Int

select ticketnum,POnum,Ext_Price,qty,shipping,sale_price from Trans_Shipping

What I need for every shipment where will be a ticket created, our company allows its customers to break the shipment into multiple shipments but they only charge once...

So when I am trying to get a Summary report by QTY... and If the shipments are broken into more than one, then I get duplicate rows for the same ticket number.. I need to be able to calculate sum(qty),sum(price) by ticket number but I get double for Shipping value.. How can i Use shipping columns value only once.. 

Can someone help me ??


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>