select Good_ID,GoodName from tb_Good where Left(Good_ID,4)=@SuperGood_ID 这地方,

解决方案 »

  1.   

    select (select Good_ID from tb_Good where Left(Good_ID,4)=@SuperGood_ID),
           (select GoodName from tb_Good where Left(Good_ID,4)=@SuperGood_ID), 
     Sum(tb_Bill_Detail.GoodSum),Sum(tb_Bill_Detail.Total),Avg(tb_Bill_Detail.TaxTotal),Avg(tb_Bill_Detail.Tax_Price),Sum(tb_Bill_Detail.Tax_Total) from tb_Bill_Detail,tb_Bill
    where tb_Bill_Detail.Good_ID=Good_ID and tb_Bill.ValidDate between @BeginDate and @EndDate
    and tb_Bill.BillType=@BillType and Client_ID=@Client_ID and TransactID=@StaffID and Depot_ID=@DepotID