2 Replies Latest reply on Oct 16, 2014 4:35 AM by WilliamSouth

    SQL CHART YEARLY SALES ERROR

    WilliamSouth

      Title

      SQL CHART YEARLY SALES ERROR

      Post

      Trying to  make a chart for my yearly sales  by Month. I can it to work by day but when I try to group it  by MONTHNAME it dose not work. I get an error.

      My Y AXIS

      SELECT SUM(a."Subtotal")
      FROM "Invoices" a
      INNER JOIN "Invoice Data" b ON a."Invoice ID" = b."INVOICE ID MATCH FIELD"
      WHERE YEAR(a."Date") = YEAR(CURDATE)
      GROUP BY a."Date"

      MY X AXIS

      "SELECT MONTHNAME(Date)
      FROM "Invoices" a
      WHERE YEAR(a. "Date") = YEAR(CURDATE)
      ORDER BY a.\"Date\" ASC
      " ;