在SQL中:
insert into t2
select * from t1 where a=left(convert(varchar(8),dateadd(MM,-14,convert(datetime,'200301')),112),6)

解决方案 »

  1.   

    ACCESS中不支持自动执行,这个你要在程序中进行。
      

  2.   

    --数据转换可以用,要在程序中分别下面的两条语句,或者在ACCESS中写两个查询来实现:--删除t2表中的数据
    delete from t2 where 时间字段a=format(dateadd("m",-14,date),"yyyymm")--从t1插入数据到t2表
    insert into t2 select * from t1 where 时间字段a=format(dateadd("m",-14,date),"yyyymm")
      

  3.   

    楼上的大哥,能否具体些,我现在用:
    insert into t2 select * from t1 where format(t1.a,"yyyymm")="200301"delete form t1 where format(t1.a,"yyyymm")="200301"'200301'换为参数如何写(vb)?不能用参数吗?