如题

解决方案 »

  1.   

    MS SQL
      select datediff(mm,'2002-02-01','2003-02-01')ACCESS
      select datediff('m',#2002-02-01#,#2003-02-01#)
    在ACCESS中日期是用#号括起来的
      

  2.   

    if ado_pub.RecordCount=1 then
        begin
            ado_pub1.SQL.Clear;
            ado_pub1.SQL.Add('select * from v_xs');
            ado_pub1.SQL.Add('where datediff(day,:date,x_x_date)<=:d_count');
            ado_pub1.Parameters.ParamByName('date').Value:=date;
            ado_pub1.Parameters.ParamByName('d_count').Value:=ado_pub.fieldbyname('d_count').AsInteger;
            ado_pub1.Open;
            if ado_pub1.RecordCount<>0 then
                showmessage('近日有该交纳管理费的墓穴,请您留意续费通知!');
            ado_pub1.Close;
        end;那上面的代码当执行到ado_pub1.open时,哪里错了?
      

  3.   

    to: bee2518(迷茫ing)
    select datediff('m',#2002-02-01#,#2003-02-01#)不行啊
      

  4.   

    http://www.1sky1.com/edu/n8007c27.shtml
      

  5.   

    你的datediff语法错了 查查帮助吧 老大
    day加上单引号
      

  6.   

    把你的sql语句input出来再在access中执行一下 看看是什么问题
      

  7.   

    在access中执行
    select * from v_xs where datediff(''day'',#'2004-11-12'#,#'2004-11-12b'#)<=1
    提示操作符丢失,各位帮我看看