Hi all, i have a column Deposit_Date with date type like '1997-08-17 03:43:00.000' and i need to run this code:
i can't find right conversion in TD
You current logic is not SARGable (= searchable argument), i.e. you loose index access & statistics.
Rewrite it to
WHERE Deposit_Date <= Current_Date -2
Comparing Timestamp and Date automatically converts the Timestamp to a date.
Even better, switch to a Timestamp
WHERE Deposit_Date < Cast(Current_Date -1 AS TIMESTAMP) -- caution: -1, not -2