Select to view content in your preferred language

how to write  sql  in  query.where?

441
1
10-11-2011 06:03 PM
yanli
by
Emerging Contributor
i  wan't query in point layer according to  Field "date" ,the  Field type id datetime
for example , one Graphic ,[ date:2011- 10-11 20:21:00]

.....
 var query:Query = new Query();
                query.outSpatialReference = myMap.spatialReference;
                query.outFields = [ "date", "name"];
                query.returnGeometry = true;
                query.where = "name = 'Alaska' AND date like '*2011-10-11*'";//*******this is wrong,how to wite
                queryTask.execute(query, new AsyncResponder(onResult, onFault));
....

how  to find  the graphic, which  the name is"Alaska"  and  the date is 2011-10-11?
besides,how find the lastest time graphic?
query.where  ="max (date)"? this  is wrong
how  to write the  query.where?
Tags (2)
0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus
Yan,

   The complexity of what is allowed in the where of a query is very limited. Here is what should work for getting a date regardless of the time for 2011-10-11

date >= '2011-10-11' And date < '2011-10-12'
Using Sub queries is does not work and that is what you would have to use to get Max to work.
0 Kudos