Invalid parentheses and missing Methods

5 posts, 0 answers
  1. Andy
    Andy avatar
    25 posts
    Member since:
    Aug 2011

    Posted 02 Jun 2013 Link to this post

    Version 2013.1.220.40

    I have an expression that combined an 'or' with a 'between'

    The resulting SQL is:

    ([Net Calorie Deficit] < 500 OR ([Steps Taken] >= 10000) AND ([Steps Taken] <= 20000)) 

    I believe there needs to be parentheses around the 2 between conditions.

    If I have rows with [Net Calorie Deficit] = 400 and [Steps Taken] = 30000 it will not return it because the 'AND ([Steps Taken] <= 20000))' will be treated as its own expression.

    Because of this I was going to parse the expressions myself.  On the 'Getting familiar with Server-Side API' page:
    http://www.telerik.com/help/aspnet-ajax/filter-getting-familiar-with-server-side-api.html

    The methods: GetAllExpressionItems, GetSingleExpressionItems, GetSingleExpressionItems, and GetGroupExpressionItems  are listed but I can't find them off my control.












  2. Andy
    Andy avatar
    25 posts
    Member since:
    Aug 2011

    Posted 02 Jun 2013 Link to this post

    Ok... I see the documentation is for  2013.2.522.0 which hasn't been released yet which explains the many members and classes I can't find.

    However I do believe that any single expression that resolves into 2 separate SQL expressions should be within parentheses.   

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Andrey
    Admin
    Andrey avatar
    836 posts

    Posted 05 Jun 2013 Link to this post

    Hi,

    If I understand correctly what you are implying and based on the information on the MSDN site for the "AND" keyword there should be no difference when using parentheses or not.

    Let me know if I am missing something.

    Regards,
    Andrey
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  5. Andy
    Andy avatar
    25 posts
    Member since:
    Aug 2011

    Posted 05 Jun 2013 Link to this post

    Based on my research MS does define the order of precedence without parentheses.

    The result of the above query is different based on if the OR or the AND is evaluated 1st.

    Since I switched to the beta and can now get a callback as each expression evaluated I am fixing it myself.
  6. Andrey
    Admin
    Andrey avatar
    836 posts

    Posted 10 Jun 2013 Link to this post

    Hi,

    Yes, there are some cases when there might be differences. I am glad that you were able to resolve your case.

    Regards,
    Andrey
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017