Select to view content in your preferred language

searching a date range

1320
5
Jump to solution
02-22-2012 06:32 AM
JamesArmstrong
Occasional Contributor
I am using the enhance serch widget from Robert.  Outstanding!! 

Is there a way to include a search by range - such as  a date or price range?  Such are sales date for parcels.

I suspect that this may be something that needs to be edited in the source code, but thought that there may be a query statement that could also be used.

Thanks in advance

James
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable
Original User: rscheitlin

James,

   OK than try this:

<expression alias="Date Search"                            textsearchlabel="Search by Typing Full SQL  example:[ SALE_DATE &gt;= '04/03/2011' AND SALE_DATE &lt;= '07/01/2011'  ]...">[value]</expression>

View solution in original post

0 Kudos
5 Replies
by Anonymous User
Not applicable
Original User: rscheitlin

James,

   It can be done in a Query but..... As multiple field queries are not supported in the eSearch expressions in the same way that others are you have to do a workaround.

The Query would look like this assuming you are using SDE and not a file GDB:

SALE_DATE >= '2010-03-03 00:00:00' AND SALE_DATE <= '2012-03-03 00:00:00'


You would have to manually type this in the TextBox of the eSearchWidget when you choose this expression in the dropdown:

<expression alias="Open SQL" textsearchlabel="Search by Typing Full SQL example:[ SALE_DATE >= '2010-03-03 00:00:00' AND SALE_DATE <= '2012-03-03 00:00:00' ]...">[value]</expression>
0 Kudos
JamesArmstrong
Occasional Contributor
the actual query work great, though one issue.  This is the code I put into the xml.

<expression alias="Date Search"
                           textsearchlabel="Search by Typing Full SQL example:[ SALE_DATE >= '04/03/2011' AND SALE_DATE <= '07/01/2011' ]...">[value]</expression>

as you can see I did change the data format a bit, but it does seem to work (I am using a SDE database) when I use the SALE_DATE >= '04/03/2011' AND SALE_DATE <= '07/01/2011' in the entry box. 

This issue is that there is a parseing error if the SALE_DATE >= '04/03/2011' AND SALE_DATE <= '07/01/2011' is left in as the example string.  If part of it is removed, there is no problem.  I thought it may have something to do with the quotation marks around the date, but when removed, the same parsing erro happens.

JAMES
0 Kudos
by Anonymous User
Not applicable
Original User: rscheitlin

James,

   Are you using version 2.5.1.3? If not that that is the problem.
0 Kudos
JamesArmstrong
Occasional Contributor
yes  I am using the lates version.

I now dont think the issue is with the single quottons marks.  Instead, it seems the issue centers on the <= sign.  I have removed it, or used just the = sign and even the > and the parsing error is not thrown.  With that sign (or even =<) the parsing error is thrown. 

James
0 Kudos
by Anonymous User
Not applicable
Original User: rscheitlin

James,

   OK than try this:

<expression alias="Date Search"                            textsearchlabel="Search by Typing Full SQL  example:[ SALE_DATE &gt;= '04/03/2011' AND SALE_DATE &lt;= '07/01/2011'  ]...">[value]</expression>
0 Kudos