Prevent repeting Join fields records from one table

J

Jahanzaib

Following sql statement is used:
SELECT TSales.OrderDate, TSales.Unit, BundlesTbl.Segment, BundlesTbl.Rule,
BundlesTbl.Amount, TSales.SumOfAmount AS TSales
FROM TSales LEFT JOIN BundlesTbl ON TSales.CheckDate = BundlesTbl.CheckDate;


For obtainnig this (*Tsales from Tsales is repeating):
OrderDate Unit Segment Rule Amount TSales

04/04/08 A 1 Bundle 6 3600 139385
04/04/08 A 2 Bundle 4 2400 139385
04/04/08 B 2 Bundle 4 1600 129376
04/04/08 B 1 Bundle 6 1200 129376


How can I obtain this (T Sales only one time for each unit each day):
OrderDate Unit Segment Rule Amount TSales

04/04/08 A 1 Bundle 6 3600 139385
04/04/08 A 2 Bundle 4 2400 0
04/04/08 B 2 Bundle 4 1600 129376
04/04/08 B 1 Bundle 6 1200 0

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top