这个select 语句要怎么写
Set rs=Server.CreateObject("Adodb.RecordSet")
sql="select Pono,Date,Style,Customer,Factory,sum(TotalPrice) as Total_Price from Statistics where Date between #" & FirstDate & "# And #" & EndDate & "# and Factory='"&Factory&"' roup by Date order by id desc"
最后输出"Total_Price "
请要这个语句要怎么改才正确!如何输出显示Total_Price的值
参考答案:如果你想计算每日的订单总额应该是:
sql="select Date,sum(TotalPrice) as Total_Price from Statistics where Date between #" & FirstDate & "# And #" & EndDate & "# and Factory='"&Factory&"' group by Date order by Date desc"
如果你想要更多新信息:
sql="select Pono,Date,Style,Customer,Factory,sum(TotalPrice) as Total_Price from Statistics where Date between #" & FirstDate & "# And #" & EndDate & "# and Factory='"&Factory&"' group by Pono,Date,Style,Customer,Factory,id order by id desc"
select后非聚集运算Column必须出现在group by后。