Select to view content in your preferred language

File Geodatabase API ExecuteSQL with Datetime condition

4025
1
Jump to solution
09-15-2014 06:04 AM
KarelVondracek
Emerging Contributor

Hi.

I'm trying to execute and SQL query with datetime condition on a geodatabase, but an Exception ('An invalid SQL statement was used.') is thrown. The code is bellow:

var sqlStatement = "SELECT * FROM TableName WHERE Edited > '15.9.2014 14:28:58'";

foreach (Row row in geodatabase.ExecuteSQL(sqlStatement))

{

var temp = row.GetGlobalID();

Console.Write(temp);

}

Okay, there is someting wrong with SQL statement (the WHERE part), but how can I write it correctly? I there a problem in Datetime format? Or is that kind of query even possible with File Geodatabase API (using version 1.3)?

0 Kudos
1 Solution

Accepted Solutions
LanceShipman
Esri Regular Contributor

Try:

"SELECT * FROM TableName WHERE Edited > date '15.9.2014 14:28:58'"

View solution in original post

0 Kudos
1 Reply
LanceShipman
Esri Regular Contributor

Try:

"SELECT * FROM TableName WHERE Edited > date '15.9.2014 14:28:58'"

0 Kudos