Sql in dBeaver Date Format
I M Using dBeaver to Practise to Sql Queries. While the Date Format Is Set to Mm-Dd-Yy and I Use the Same Format in Syntax the Output Value Is Not a Date...
I m using dBeaver to practise to SQL queries. While the date format is set to MM-dd-yy and I use the same format in syntax the output value is not a date datatype. Maybe it is a float.
When coding the following query the output value of action_date is '02' and '02' (probably float)instead of '02-13-22' and '02-14-22'. How can i fix it so i can subtract the dates :
WITH users (user_id, action, action_date)
AS (VALUES
(1, 'start', CAST('02-13-22' AS date)),
(1, 'cancel', CAST('02-14-22' AS date))
SELECT * FROM users