LastUpdated < LastApplied

  • All our database tables have two fields; LastUpdated and LastApplied. New records will have both fields equal and updated records will have LastUpdated > LastApplied.

    We noticed in a large table that 6 records had LastUpdated < LastApplied and found it was by -16 ms. Is there a convenient way of ignoring the ms element when testing for equality?

  • Assuming these columns are datetimes, you could convert using style 120. The real issue may be that you have insert processes that have a separate update statement following the insert, the first creating the LastUpdated value, and the second creating the LastApplied value. Perhaps you need to create both values in the initial insert statement or use a local variable.

    --Jonathan



    --Jonathan

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply