-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Description
What happens?
When using the date_add function with the interval keyword "week," DuckDB throws a syntax error. This issue is specific to "week," as it works correctly with other keywords like "month."
To Reproduce
-
Execute the following SQL query using DuckDB:
SELECT date_add(INTERVAL 3 month, current_date);
Expected output: A date that is three months from the current date.
Actual output: The query executes successfully, and the output is correct.
-
Execute the following SQL query using DuckDB:
SELECT date_add(INTERVAL 3 week, current_date);
Expected output: A date that is three weeks from the current date.
Actual output: DuckDB throws a syntax error:
Parser Error: syntax error at or near "week" LINE 1: SELECT date_add(INTERVAL 3 week, current_date);
-
Execute the following SQL query using DuckDB as a workaround:
SELECT date_add(INTERVAL '3 week', current_date);
Expected output: A date that is three weeks from the current date.
Actual output: The query executes successfully, and the output is correct.
OS:
DuckDB Version:
web
DuckDB Client:
@duckdb/duckdb-wasm@1.28.1-dev23.0
Full Name:
Francois CORIC
Affiliation:
None
Have you tried this on the latest main
branch?
I have not tested with any build
Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?
- Yes, I have