Skip to content

%sql fails when query contains a Negative number #190

Open

Description

@feverittm

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.

Activity

  1. acountrec commented on Mar 10, 2021

    @acountrec

    have the same issue

  2. duncandewhurst commented on May 9, 2021

    @duncandewhurst

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions