Select to view content in your preferred language

read ESRI FileGeoDataBase / sql filter on date field

3213
2
07-17-2013 04:23 AM
RalfWessels
Emerging Contributor
hello,

I have a file geodatabase (10.1) and want to read out data by SQL-select on date fields, but I can`t get it working.

..tried the following codes:
....where date_field < '2013/07/09 17:34:49'
....where date_field < '2013-07-09 17:34:49'   
....where "date_field" < date '2013-07-09 17:34:49'

but nothing works.

ralf
0 Kudos
2 Replies
LanceShipman
Esri Regular Contributor
This "date_field < date '2013-07-09 17:34:49' " should work.

  EnumRows attrQueryRows;
  if ((hr = table.Search(L"*", L"UP_DATE > date '2007-05-23 11:13:59'", true, attrQueryRows)) != S_OK)
  {
    wcout << "An error occurred while performing the attribute query." << endl;
    ErrorInfo::GetErrorDescription(hr, errorText);
    wcout << errorText << "(" << hr << ")." << endl;
    return -1;
  }
0 Kudos
RalfWessels
Emerging Contributor
hi Lance,

>>>This "date_field < date '2013-07-09 17:34:49' " should work.

Great, it works - thanx a lot for that quick answer

best greetings from Berlin

Ralf Wessels
0 Kudos