2 Replies Latest reply: Dec 13, 2016 7:44 AM by Guido Caffa RSS

    Count total sales

    Guido Caffa

      The customer wants me to count all the sales that has an especific type of item. For example:

       

      Table: ITEMS, this are the items that the customer sales.

      ItemCodTypeItem
      AA10001
      AA90001
      AC60003
      PA33302

       

      TABLA: TypeItem, this are the cateroies of the items

      CodTypeItemDesTypeItem
      01

      FOOD

      02DRINKS
      03OTHER

       

      TABLA: Sales,

      IDClienDateTotal
      1Coca20161210555
      2Pepsi201612112156
      3Pepsico20161213100

       

      TABLA: SalesDet, sales detail.

      IDITEMTOTAL
      1AA1001326
      1PA333200
      2AA100100
      3AC600667

       

      The customers wants a table like this

       

      TypeNumer of salesavg amount per sale
      Food2500
      drink3123
      other6900