sql="select * from [200409] where 采样时间 between '2004-7-6' and '2005-1-6'
union all select * from [200410] where 采样时间 between '2004-7-6' and '2005-1-6'
union all select * from [200411] where 采样时间 between '2004-7-6' and '2005-1-6'
union all select * from [200412] where 采样时间 between '2004-7-6' and '2005-1-6'
union all select * from 仪表数据 where 采样时间 between '2004-7-6' and '2005-1-6'
"
rs.open sql
rs=nothing

解决方案 »

  1.   

    tqqonline(蜡烛) :这样我试过,还是很慢。高手们,努努力啊!!!
      

  2.   

    同意tqqonline(蜡烛) 的方式,但按照你给出的条件,从sql语句进行优化的效果是很有限的,建议考虑从数据表结构上进行改变
      

  3.   

    sql="select * from [200409] where 采样时间 between '2004-7-6' and '2005-1-6'
    union all select * from [200410] where 采样时间 between '2004-7-6' and '2005-1-6'
    union all select * from [200411] where 采样时间 between '2004-7-6' and '2005-1-6'
    union all select * from [200412] where 采样时间 between '2004-7-6' and '2005-1-6'
    union all select * from 仪表数据 where 采样时间 between '2004-7-6' and '2005-1-6'
    "
    rs.open sql
    rs=nothing