locked
The Declare SQL construct or statement is not supported. RRS feed

  • Question

  • DECLARE @date1 date DECLARE @date2 date
    SET                @date1 = '2018-01-07'
    SET                @date2 = '2018-01-24'
                                 SELECT        *
                                  FROM            table1
                                  WHERE        Dates = @date1 OR
                                                           Dates = @date2

    The following errors were encountered while parsing the contents of the SQL pane:

    The Declare SQL construct or statement is not supported.



    Naresh

    Monday, January 29, 2018 6:42 AM

All replies

  • which editor are you using?

    The code doesnt seem to have any obvious errors


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    Monday, January 29, 2018 7:06 AM
  • I am getting this error in DataSet query builder in reporting service in visual studio.

    Naresh

    Monday, January 29, 2018 7:15 AM
  • DECLARE @date1 date DECLARE @date2 date
    

    Hello,

    I can't reproduce the error, but I guess it's cause by the two, not separated DECLARE Statement; add a semicolon between =>

    DECLARE @date1 date; DECLARE @date2 date;

    or use one declare and separate the variable with a comma:

    DECLARE @date1 date, @date2 date;


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Monday, January 29, 2018 7:32 AM
  • I am getting this error in DataSet query builder in reporting service in visual studio.

    Naresh

    It works fine for me in report builder

    what version are you on?


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    Monday, January 29, 2018 8:00 AM
  • vs 2017.

    I am getting output in query designer but as 'cell read only'.

    And also report is not generating.


    Naresh

    Monday, January 29, 2018 8:19 AM
  • vs 2017.

    I am getting output in query designer but as 'cell read only'.

    And also report is not generating.


    Naresh

    what do you mean cell read only?

    Can you show the screenshot?


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    Monday, January 29, 2018 8:23 AM