[求助]如何将sql的sum求和结果赋值给一个变量,并显示在vb文本框中
请问:如何将sql的sum求和结果赋值给一个变量,并显示在vb文本框中如:select sum(jresult2)
from jiesuan2
where gno='2006041800001';
表1为 gno jresult
2006041800001 12
2006041800001 6.5
2006041800001 23.8
表2为 gno jresult2
2006041800001 42.3
Dim sgnA As Single
sgnA = "select sum(jresult) From jiesuan Where gno = '" & Text1 & "'"
Text1.text为2006041800001
为何不行? 请指教,谢谢!!