[Mapserver-users] OGR Layer with SQL

Frank Warmerdam warmerdam at pobox.com
Thu Jul 29 10:38:10 PDT 2004


Blaine Hackett wrote:
> Frank
> 
> That worked great!  Thanks!
> 
> Now, however, I need to find out how to do this with a
> date/time field.
> 
> I tried using the same syntax but with the time: 
> <SrcSQL>SELECT * FROM subset WHERE(tim_time >
> '7:00:00 AM') AND (tim_time < '7:30:00
> AM')</SrcSQL>
> but that threw me the "Open Failed" error.  There must
> be someplace that discusses how you might format SQL
> for time/date field but I can't find anything.  
> 
> Got any ideas?

Blaine,

Hmm, it is odd that it would report "open failed".  Perhaps this is what
the VRT driver does if the SrcSQL statement fails on the underlying datasource
(aka the ODBC database).

I don't know the correct syntax for the time comparisons. I would suggest
experimenting with the SQL in a direct ODBC SQL client till you are getting
the right sort of responses and then trying to embed it in a .ovf file.

Good luck,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the MapServer-users mailing list