[fdo-users] FDO SDF Defect : can't filter on date
Badreddine Karoui
badreddine.karoui at autodesk.com
Wed Jan 2 11:11:37 EST 2008
You should be using the string format of the FdoDateTime class as:
select->SetFilter(FdoPtr<FdoFilter>(FdoFilter::Parse(L"datetime = TIMESTAMP '2006-04-21 19:40:10.0001'")));
The above line is taken from the SDF provider unit test.
Badreddine
-----Original Message-----
From: fdo-users-bounces at lists.osgeo.org [mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Bruno Scott
Sent: Wednesday, January 02, 2008 8:32 AM
To: fdo-users at lists.osgeo.org
Subject: [fdo-users] FDO SDF Defect : can't filter on date
I try to execute this type of query
select MYKEY from MYTABLE where MYDATE = 2007-01-01'
The query execution works fine but as soon as i try to fetch the first
record
i got this exception "Cannot convert string to DateTime"
Sample code:
FdoPtr<FdoISelect> sampleSelect;
FdoPtr<FdoIFeatureReader> sampleFeatureReader;
sampleSelect = (FdoISelect
*)m_connection->CreateCommand(FdoCommandType_Select);
sampleSelect->SetFeatureClassName(_T("MYTABLE"));
sampleSelect->SetFilter(_T("MYDATE = 2007-01-01'"));
FdoPtr<FdoIdentifier>queryPropertyName = FdoIdentifier::Create(_T("MYKEY"));
FdoPtr<FdoIdentifierCollection> propertyCollection =
sampleSelect->GetPropertyNames();
propertyCollection->Add(queryPropertyName);
sampleFeatureReader = sampleSelect->Execute();
sampleFeatureReader->ReadNext() // this line throw the exception
I have the same problem if i use FdoISelectAggregates
Bruno
--
View this message in context: http://www.nabble.com/FDO-SDF-Defect-%3A-can%27t-filter-on-date-tp14578427s18162p14578427.html
Sent from the fdo-users mailing list archive at Nabble.com.
_______________________________________________
fdo-users mailing list
fdo-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users
More information about the fdo-users
mailing list