fix on sql access using Timestamp.timestamp for comparison