I have this line, how can i reproduce it into CQL? I'm using Amazon Keyspaces which based on Cassandra.
DATEADD(day, @p_daysback, GETDATE());
I have this line, how can i reproduce it into CQL? I'm using Amazon Keyspaces which based on Cassandra.
DATEADD(day, @p_daysback, GETDATE());
Cassandra 4.0 supports date/time arithmetic (added in CASSANDRA-11935), so maybe Amazon Keyspaces support it as well. Basically you either need currentDate()
function or cast(now() as date)
to get current date, and then add or subtract the given amount of days, like (to get back to 3 days from today):
currentDate() - 3d