SELECT dbo.lydate(a.Check_Date) AS 日期, b.TypeNO AS 编号, c.TypeName AS 类别名称, 
      SUM(a.FPrice * a.Qty) AS 销售金额, 
      SUM(a.Rebate) AS 折扣金额, SUM(a.FPrice * a.Qty - a.Rebate) AS 实际销售金额
FROM V_ShopSale a INNER JOIN
      Goods b ON a.GoodsNO = b.GoodsNO INNER JOIN
      GoodsType c ON b.TypeNO = c.TypeNO
WHERE (a.State = 1) AND a.Create_Date>='2007-03-01 00:00:01' AND a.Create_Date<='2007-03-10 23:59:59' GROUP BY dbo.lydate(a.Check_Date), b.TypeNO, c.TypeName
