Forum Replies Created

Viewing post 1 (of 1 total)

  • RE: How do I combine records

    SELECT

    substring(salesman1, 1, 7),

    DATEPART(mm,CONVERT(DATETIME,DateEntered,106)) as Month,

    SUM(grand_inv_total) as TotalSales

    FROM Sales

    WHERE DATEPART(yy,CONVERT(DATETIME,DateEntered,106)) = 2011

    AND SalesMan1 <> ''

    GROUP BY substring(salesman1, 1, 7), DATEPART(mm,CONVERT(DATETIME,DateEntered,106))

    ORDER BY substring(salesman1, 1, 7), DATEPART(mm,CONVERT(DATETIME,DateEntered,106))

    /PA

Viewing post 1 (of 1 total)