Select to view content in your preferred language

Problem with date Query

656
3
04-05-2012 09:18 AM
Yusufalbanki
Deactivated User
Hi All,

I have a query that should return records according to selected duration. I did it but it return strange records.

my function :

protected function button1_clickHandler(event:MouseEvent):void
   {
    
    datetimeFormatter.dateTimePattern="yyyy-MM-dd HH:mm:ss";
   
    var strFromDate:String=datetimeFormatter.format(dfFrom.selectedDate);
   
    var strToDate:String=datetimeFormatter.format(dfTo.selectedDate);
   
    getIncidentsParam.where="Inc_AlarmTime  > date '"+strFromDate+"' AND Inc_AlarmTime  < date '"+strToDate+"'";
   
    getIncidents.execute(getIncidentsParam);
   }

I read the date from datefield.

The returned records sometimes before the duration like attached snapshot[ATTACH=CONFIG]13276[/ATTACH]

Is there solution for this problem.

Thanks
Yusuf
Tags (2)
0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus
Yusuf,

   I spent a good deal of time with esri tech support on date range search issue and basically this is what I got to work:

FeatLay.timeDefinition = new TimeExtent(DatePicker1.selectedDate,DatePicker2.selectedDate);


Apply a time extent to a actual featurelayer.

We never got a great than or equal to and a less than or equal to query to work in a where clause.

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote) as shown below:
0 Kudos
Yusufalbanki
Deactivated User
Thank you very much Robert for your reply.
0 Kudos
DasaPaddock
Esri Regular Contributor
0 Kudos