queryTask = new esri.tasks.QueryTask("http://........../MapServer/0"); //build query filter query = new esri.tasks.Query(); query.returnGeometry = false; query.outFields = ['*']; query.where = "DATE_CREATED > TO_DATE('2004-10-04 00:00:00','YYYY-MM-DD HH24:MI:SS')"; queryTask.execute(query, showResults);
To include the date in where clause need to use standard sql syntax, and also it will not support sub queries, I had the same issue in SL api & Arcgis server 10.2.1, it solved when I changed like below :
featureLayer.Where = "SURVEY_DATE >= date '" + dpFromDate.SelectedDate.Value.ToString("yyyy-MM-dd")
+ "' and SURVEY_DATE <= date '" + dpToDate.SelectedDate.Value.ToString("yyyy-MM-dd") + "'";
for more info ref the link, this may help ArcGIS Help (10.2, 10.2.1, and 10.2.2)
Hi Andrian,
Try this
query.where = "DATE_CREATED > to_date('10/04/2004 00:00','MM/DD/YYYY HH24.MI')";