如下语句:就是一个查询两日期之间所有数据的sql,我想得到支出和收入的总和,用了sum函数,select sum(z_money) as z_m,sum(s_money) as s_m,[date] from [product],没有效果,用了group by having也是没有效果,是不是需要另外新建一个rs记录集,请高人指教
if isnull(keytext) or keytext="" then sql = sql
else if isnull(keytext2) or keytext2="" then sql = sql & " where [date] = #"&keytext&"#" else sql = sql & " where [date] between #"&keytext&"# and #"&keytext2&"#" end if
end if