Try wrapping your date with hash symbols as follows:
SELECT * from yourtable WHERE yourdatecolumn < #2005-01-20#
I hope this helps.
SW Florida's First ISP
----- Original Message -----
From: "Peters, Sven" <sven.peters@stripped>
Sent: Friday, January 21, 2005 3:24 AM
Subject: AW: Excel parameter-query with MyODBC and DateTime Field
> I tried this already...didn't help. It looks like Excel has is own
> internal format (probably according to the windows settings).
> What helped was the following tip (just for those who are interested):
> I'm not sure is it apply in a your case but when I was using MS Query with
> parameters I saw that MS doesn't like parameters longer (in string) then
> 4 digits.
> The solution was in my case split parametric query among a smaller parts
> CustomerID < ? , in case where ? Could be longer then 4 digits Should be
> CustomerID < CONCAT(?,?)
> In your case I think could help
> select * from table where date > CONCAT(?,"-",?,"-",?)
> where instead one parameter you should put three for year, month and day
> -----Ursprüngliche Nachricht-----
> Von: Mike Harknett [mailto:mikeh@stripped]
> Gesendet: Donnerstag, 20. Januar 2005 20:29
> An: Peters, Sven
> Cc: myodbc@stripped
> Betreff: Re: Excel parameter-query with MyODBC and DateTime Field
> I don't know if this will help but you could try formatting the date as
> 'yyyymmdd hh:nn:ss'
> Peters, Sven wrote:
>>I'm trying to pull some data from a MySQL 4.1 with the ODBC Driver
>>using Excel and a parameter query like
>>select * from table where date > ?
>>with date as a datetime field.
>>I want the date parameter come from another excel cell. This doesn't
>>work and I guess there is some Excel / ODBC conversion which results in
>>a datetime somehow different than entered in excel.
>>Any help is appreciated.
> MySQL ODBC Mailing List
> For list archives: http://lists.mysql.com/myodbc
> To unsubscribe: http://lists.mysql.com/myodbc?unsub=1