SELECT pr_name,
sub_pr_name,
SUM(op_bal)AS opb,
SUM(Inqty)AS inqty1
FROM purchasereport
WHERE SDate
BETWEEN #"+df1.format(from_d)+"#
AND #"+df1.format(to_d)+"#
AND comp_name='"+cb.getSelectedItem()+"'
GROUP BY comp_name,pr_name,sub_pr_name
但如果起始日期仅为01或02,则会显示结果。
答案 0 :(得分:0)
尝试将SDate
BETWEEN #"+df1.format(from_d)+"#
AND #"+df1.format(to_d)+"#
放入括号中。