This is a migrated thread and some comments may be shown as answers.

Invalid parentheses and missing Methods

4 Answers 54 Views
Filter
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Iron
Andy asked on 03 Jun 2013, 01:50 AM
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.












4 Answers, 1 is accepted

Sort by
0
Andy
Top achievements
Rank 1
Iron
answered on 03 Jun 2013, 04:37 AM
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.   

0
Andrey
Telerik team
answered on 05 Jun 2013, 12:23 PM
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.
0
Andy
Top achievements
Rank 1
Iron
answered on 05 Jun 2013, 02:13 PM
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.
0
Andrey
Telerik team
answered on 10 Jun 2013, 08:52 AM
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.
Tags
Filter
Asked by
Andy
Top achievements
Rank 1
Iron
Answers by
Andy
Top achievements
Rank 1
Iron
Andrey
Telerik team
Share this question
or