Solved! Go to Solution.
The workarounds are
you can do request in POST
or
dirty the queryvar dirty = (new Date()).getTime(); var query = new esri.tasks.Query(); query.where = "MyField= " + MyValue+ " AND " + dirty + "=" + dirty; ...
var dirty = DateTime.UtcNow; Query query = new Query(); query.ReturnGeometry = true; query.OutFields.Add("*"); query.Where = QueryParametersTextbox.Text + " AND " + dirty + "=" + dirty;
string dirty = DateTime.UtcNow.Ticks.ToString(); Query query = new Query(); query.ReturnGeometry = true; query.OutFields.Add("*"); query.Where = QueryParametersTextbox.Text + " AND " + dirty + "=" + dirty;
I am on 10.2.2 all updates and patches applied and JS API 3.10 and I still have the issue. even sequencing the queries will not work, nor does the "dirty" query technique. I have not been able to make JS API to use POST yet (not sure if I can) and I am on enterprise geodatabase (postgres). Two queries back to back or simultaneous, the first one always successful, the second one fails. Reordering them guarantees that there is no issue with the query itself. Extremely frustrating...
No! I am not sure how did I solve it though. IT was a long time ago.
Even I had the same issue in Sliverlight api with server 10.2.1, FeatureLayer query fails when using date in where clause.
It works for me when change the query syntax 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") + "'";
ref the link for more details : ArcGIS Help (10.2, 10.2.1, and 10.2.2)