This is a migrated thread and some comments may be shown as answers.
Greater Than And Less Than Filter
2 Answers 17 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Trevor
Top achievements
Rank 1
Trevor asked on 07 May 2012, 09:21 PM
I have an Open Access data source which gives me an error when I try to combine two conditions on the same field. I need to filter to only projects which have a status >=25 and <=40

line 1:132: unexpected char: '@'
Original Query: DEFINE EXTENT xt FOR SQ.OpenAccess.Project; SELECT * FROM xt AS this WHERE this.Rep == $1 AND this.Status >= $2 AND this.Status <= @Status

Here is the code which was generated by the wizard.

<telerik:OpenAccessDataSource ID="OpenAccessDataSource1" runat="server"
     ObjectContextProvider="SQ.OpenAccess.EntitiesModel, SQ.OpenAccess"

onselecting="OpenAccessDataSource1_Selecting" TypeName="SQ.OpenAccess.Project"
 
Where="this.Rep == @Rep AND this.Status &gt;= @Status AND this.Status &lt;= @Status">
<whereparameters>
<asp:QueryStringParameter DefaultValue="1" Name="Rep"  QueryStringField="USERID" />
<asp:QueryStringParameter DefaultValue="25" Name="Status"  QueryStringField="MInStatus" />
<asp:QueryStringParameter DefaultValue="40" Name="Status"  QueryStringField="MaxStatus" />
</whereparameters>
</telerik:OpenAccessDataSource>

2 Answers, 1 is accepted

Sort by
0
Jan Blessenohl
Telerik team
answered on 08 May 2012, 08:22 AM
Hello Trevor,
It looks like, because you are using the same variable name twice, we are not able to match it correctly. Can you try to use Status1 and Status2?

Regards,
Jan Blessenohl
the Telerik team
Follow @OpenAccessORM Twitter channel to get first the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
0
Trevor
Top achievements
Rank 1
answered on 08 May 2012, 02:57 PM
That worked, Thanks.  Here is the working code.
Where="this.Rep == @Rep AND this.Status >= @Status1 AND this.Status <= @Status2">
      <whereparameters>
          <asp:QueryStringParameter DefaultValue="1" Name="Rep"
              QueryStringField="USERID" />
          <asp:QueryStringParameter DefaultValue="25" Name="Status1"
              QueryStringField="MinStatus" />
              <asp:QueryStringParameter DefaultValue="40" Name="Status2"
              QueryStringField="MaxStatus" />
      </whereparameters>
Tags
General Discussions
Asked by
Trevor
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
Trevor
Top achievements
Rank 1
Share this question
or