[fdo-users] Date filter problems in SqlServerSpatial 3.7
Bruno Scott
bscott at geomapgis.com
Mon Nov 19 07:30:13 PST 2012
Hi all, since fdo 3.7 i can't filter on date.
I've digged into the debugger and find a strange behavior
The filter i'm trying to apply is
*DATE_1 > ToDate('2007-01-02')*
Internally, the provider send this to SqlServer
/CONVERT(datetime2,SUBSTRING(N'2007-01-02',8,4)+'-'+
CASE UPPER(SUBSTRING(N'2007-01-02',4,3)) WHEN
UPPER(LEFT(DATENAME(MONTH,'2000-01-01'),3))
THEN N'01' WHEN UPPER(LEFT(DATENAME(MONTH,'2000-02-01'),3))
THEN N'02' WHEN UPPER(LEFT(DATENAME(MONTH,'2000-03-01'),3))
THEN N'03' WHEN UPPER(LEFT(DATENAME(MONTH,'2000-04-01'),3))
THEN N'04' WHEN UPPER(LEFT(DATENAME(MONTH,'2000-05-01'),3))
THEN N'05' WHEN UPPER(LEFT(DATENAME(MONTH,'2000-06-01'),3))
THEN N'06' WHEN UPPER(LEFT(DATENAME(MONTH,'2000-07-01'),3))
THEN N'07' WHEN UPPER(LEFT(DATENAME(MONTH,'2000-08-01'),3))
THEN N'08' WHEN UPPER(LEFT(DATENAME(MONTH,'2000-09-01'),3))
THEN N'09' WHEN UPPER(LEFT(DATENAME(MONTH,'2000-10-01'),3))
THEN N'10' WHEN UPPER(LEFT(DATENAME(MONTH,'2000-11-01'),3))
THEN N'11' WHEN UPPER(LEFT(DATENAME(MONTH,'2000-12-01'),3))
THEN N'12' ELSE N'' END+'-'+SUBSTRING(N'2007-01-02',1,2)+
'
'SUBSTRING(N'2007-01-02',13,2)+':'+SUBSTRING(N'2007-01-02',16,2)+':'+SUBSTRING(N'2007-01-02',19,2)+':'+)/
This filter was working fine with Fdo 3.4,3.5 and 3.6
Someone has an idea of what's going on?
Bruno Scott
Geomap
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Date-filter-problems-in-SqlServerSpatial-3-7-tp5017419.html
Sent from the FDO Users mailing list archive at Nabble.com.
More information about the fdo-users
mailing list