Layer definition with date

2315
1
10-02-2014 01:09 AM
azzamwahab
New Contributor II

I have problem with the code below. I try to query based on date for the definition layer. It works if I use Objectid. Ideas? Thanks .

ArcGISDynamicMapServiceLayer layer = new ArcGISDynamicMapServiceLayer("http://gissvr/arcgis/rest/services/General/forma_my/MapServer");

//String q = "OBJECTID = 404" ; //this query returns and display

String q = "dateT > date '2014-08-01 00:00:00'" ; //nothing

layerDefs.put(Integer.valueOf(0),q );

layer.setLayerDefinitions(layerDefs);

   

mMapView.addLayer(layer);

0 Kudos
1 Reply
azzamwahab
New Contributor II

I found myself the answer.Should use; to_date('8/1/2014','MM/DD/YY')