Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

%sql fails when query contains a Negative number #190

Open
feverittm opened this issue Feb 10, 2021 · 2 comments
Open

%sql fails when query contains a Negative number #190

feverittm opened this issue Feb 10, 2021 · 2 comments

Comments

@feverittm
Copy link

When running a valid sql comment that has a negative integer as an argument:

%sql SELECT DATEADD(month, -2, SYSDATE)

It returns an error:

UsageError: unrecognized arguments: -2, SYSDATE)

If you make the '-2' a string and cast it to an INT then it works:

%sql SELECT DATEADD(month, '-2'::INT, SYSDATE)

Works.

@acountrec
Copy link

have the same issue

@duncandewhurst
Copy link

Another workaround is to remove the space before the '-': %sql SELECT DATEADD(month,-2, SYSDATE)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants