using Distinct Sum

  • Hi,

    I'm trying to join data from two tables. I have an order table and an orderline table.

    I tried using :

    select sum(od.TotalSale) as 'Net', sum(Distinct o.SalesTax) as 'Tax',

    (sum(od.TotalSale)+ Sum(distinct o.SalesTax)) as 'Amount'

    from Orders as o

    join Orderlines as od on o.TicketNumber = od.OrderTicketNumber

    But I get an error message.

    From listening comes wisdom^M^M^M+++AT0


    From listening comes wisdom^M^M^M+++AT0

  • What is the error message you are getting?

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply