我原来用了两个datetimepicker来过滤时间范围,
运行已经成功了,
不在时间范围内的数据都会被过滤掉,
但当时datagrid的多表查询sql语句没有写好,
查询出来的数据不正确。
原来的sql语句大致是这个样子
select a,b,c from table1,table2 where (... and ... or ...) group by a,b
后来我改进了sql语句,大致如下
select a,b,c=(select sum(x) from table2 where ... and ...),
d=(select sum(y) from table3 where ... and ...),
e=(select sum(z) from table4 where ... and ...)
from table1,table2,table3,table4,table5,table6
group by a,b
数据是正确了,
但是因为用了子查询,
datetimepicker不起作用了,
不管是什么时间范围,
查询出来的都是全部结果
有什么解决的办法吗?
|