怎么实现两例总和相减
rs.Open "select ((select sum(xxx) from cplk)-(select sum(yyy) from cplk)) as sum1 from cplk where (ddd='xxx' and 规格 like '%" & Text6 & "%')", con, 1, 3我想显示 XXX 列总和减YYY 列总和数量
我自己弄的 实现不了.
这个开始的时候我试过 好象是显示无效NULL
Set rs = New ADODB.Recordset
If Text6.Text = "" Then
MsgBox "请输入产品规格", vbExclamation, "提示"
End If
rs.Open "select sum(xxx)-sum(yyy) as sum1 from cplk where (zzz='sss'and 规格 like '%" & Text6 & "%')", con, 1, 3
If IsNull(rs!sum1) Then
MsgBox "没有找到相关数据", vbExclamation, "提示"
Else
Set Text7.DataSource = rs
Text7.Text = rs!sum1
End If
结果是要赋值给TEXT 是不是下面有错?