where( date()>f_createUserDate and (date()-f_createUserDate)/(f_BuyElectricityTimes)>" & txtBuyTime.Text & " and ( f_SumBuyNum/(date()-f_createUserDate)>" & txtBuyElectNum.Text & " ))
调试欢乐多
比较前最好将两边的作一个类型与格式的转换,这样比较就比较明了另外,在变量两边加单引号看看
where f_BuyDate between #" & Format(DTPicker1.Value, "yyyy-mm-dd") & "# and #" & Format(DTPicker2.Value, "yyyy-mm-dd") & "# and f_RowFlag<>255 就可以查
但如果不加format时,在xp上就可以但98上就不行
加上format 就可以了