本帖最后由 wallyhost5 于 2012-05-13 14:51:52 编辑

解决方案 »

  1.   

    直接比较a,b,不用再转成时间,可以用showmessage(a);或b;看看2个值是什么,不相同就是不相等了a:= FormatDateTime('hh:mm:ss',now);
    b:= FormatDateTime('hh:mm:ss',ADOQuery1.Fields[2].AsDateTime);
    showmessage(a);//showmessage(b);
    if a = b then
    ...
      

  2.   

    从语句上只看出下句有问题:
     a:= FormatDateTime('hh:mm:ss',now);
    应改成:
     a:= FormatDateTime('hh:nn:ss',now);