cmd.CommandText = "sel ect z.*,y.zbid as zbid,y.fid as 订单状态,y.sn as 序号,y.sl As 数量,y.dj As 单价,x.数值 As 折扣,x.MOQ as MOQ ,x.名称 As 客户名称,w.名称 As 板号,w.规格 As 规格,v.名称 as 环保要求,v.数值 as 点价"
cmd.CommandText &= ",(Sele ct sum(d.全部点数) from ( Sel ect a.zid,a.用量,b.点数,(b.点数 * a.用量 * iif(isnull(a.折扣),1,a.折扣)) As 全部点数 from {明细} As a left join {对照表} As b on a.封装 = b.封装 And a.jid = b.jid) As d where y.wlID = a.zid ) As 总点数 "
cmd.CommandText &= ",y.sl * y.dj as 小计 ,iif(y.sl * y.dj < [MOQ],[MOQ],y.sl * y.dj) AS 实收 ,(x.数值 * [总点数] * v.数值) as 参考价 "
tb.DataSource = cmd.ExecuteReader
老师 红色字的【总点数】应该怎么写。