Time comparison in VBA: inequal while same time

后端 未结 1 990
盖世英雄少女心
盖世英雄少女心 2020-12-21 10:49

I\'m moving a database from Microsoft Access to SQL server, and am validating data equality between the remote and the local table. While doing so, I encountered an oddity w

1条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-21 11:38

    Use DateDiff. It is exactly for a purpose like this to ignore the floating point errors:

    If DateDiff("s", fld.Value, rs2.Fields(fld.NAME).Value) <> 0 Then GoTo ReturnFalse
    

    0 讨论(0)
提交回复
热议问题