Select to view content in your preferred language

Error due to less than or equal (<= symbol) in query

2184
12
Jump to solution
03-06-2013 12:17 PM
PierreLarondelle
Regular Contributor
Hello,

I've tried the following query in Flash Builder 4.6 : <esri:Query id="query1FR" where = " pw_fre <= '{qText2FR.text}' "  which causes an error while compiling with a warning message telling that the value of atribute "where" associated to an element type "esri:query" must not contain the character '<'

How do I query properly in Flex using operators "<" and "<=" , can anybody show me how to do it the right way ?
Thanks already,
Pierre
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
AnthonyGiles
Honored Contributor
Pierre,

You may better off setting your where clause and the expression in the actionscript instead of the mxml. Have a look at ths older post from Robert where he help someone else out with querying dates:

http://forums.esri.com/Thread.asp?c=158&f=2421&t=278917

Regards

Anthony

View solution in original post

0 Kudos
12 Replies
AnthonyGiles
Honored Contributor
Pierre,

If you want to use < or > than you need to use:

&lt; or &gt;

Other wise the xml thinks you are closing or creating another tag

Regards

Anthony
0 Kudos
AnthonyGiles
Honored Contributor
Pierre,

Ignore my post above that relates to using the greater than and less than symbols in an xml config. You should be able to use the <=, your problem maybe that you are trying to do a less than or equal to against a text input.

Regards

Anthony
0 Kudos
PierreLarondelle
Regular Contributor
Anthony, thanks for the quick reply but I don't use an external XML config. The faulting query code is written in a Flash Builder mxml module within the <fx : Declarations> tag.

Pierre
0 Kudos
AnthonyGiles
Honored Contributor
Pierre,

I'm not in front of a system to check but try something like:

pw_fre <= {Number(qText2FR.text)}

Regards

Anthony
0 Kudos
PierreLarondelle
Regular Contributor
Anthony, the TextInput catch a date (dd/mm/yyyy) as value for querying. What I try to do is to retrieve all dates that are <= than the date entered in the TextInput.

Pierre
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Pierre & Anthony,

   mxml is still xml and you still need to escape the < and >
0 Kudos
PierreLarondelle
Regular Contributor
Ok Anthony, I will try your code and will let you know what happened.
Thanks.

Pierre
0 Kudos
PierreLarondelle
Regular Contributor
Thanks for your reply too Robert, I will modify with both your advices.

Pierre
0 Kudos
AnthonyGiles
Honored Contributor
Pierre,

You may better off setting your where clause and the expression in the actionscript instead of the mxml. Have a look at ths older post from Robert where he help someone else out with querying dates:

http://forums.esri.com/Thread.asp?c=158&f=2421&t=278917

Regards

Anthony
0 Kudos