Can I use Firebird DateAdd function in Where clause?
1 answer
The third parameter is invalid.
select
s.number,
s.warranty_start
from
serial_number s
where
s.warranty_start > dateadd(year, -3, current_timestamp)
'now'
is a string literal that can only be used with a keyword date
, eg. date 'now'
... So current_timestamp
you need to write date
'now' instead.
I prefer to use standard SQL functions like current_timestamp
DBMS specific if they are equivalent.
+5
source to share