求一个SQL查询语句

2024-11-29 02:39:17
推荐回答(1个)
回答1:

中间的and 错了,改成or
txtSQL = "select sum(散客登记.费用)+sum(团体登记.费用) as 总计 from 散客登记 where 散客登记.报名日期> =' " & DTPicker1.Value & " ' and 散客登记.报名日期< ' " & DTPicker2.Value & " ' or 团体登记.登记日期> =' " & DTPicker1.Value & " ' and 团体登记.登记日期< ' " & DTPicker2.Value & " '"