filter 串中好象不支持 year()、Month() 等 SQL 函数?(100分)

  • 主题发起人 主题发起人 zhangking
  • 开始时间 开始时间
Z

zhangking

Unregistered / Unconfirmed
GUEST, unregistred user!
要过滤出某年、某月的记录,ADODataSet 的 filter 串应当怎么写?ADODataSet 的 filter 串中好象不支持 year()、Month() 等 SQL 函数的。 用别的方法可以否?
 
filter 不支持函数,你可以在Select 时写好条件就不用Filter
或者在Select时加入year()和Month()字段然后对这两个字段Filter
 
filter支持的条件有限,你在OnFilterRecord时间下编写复杂的过滤条件
 
filter是在本机内存中对数据集进行过滤,sql函数自然无法执行
应该用delphi函数取到你要的值,然后将结果拼成字符串再加到filter里
 
后退
顶部