List:MySQL ODBC« Previous MessageNext Message »
From:Patrick Sherrill Date:January 21 2005 1:24pm
Subject:Re: Excel parameter-query with MyODBC and DateTime Field
View as plain text  
Try wrapping your date with hash symbols as follows:
SELECT * from yourtable WHERE yourdatecolumn < #2005-01-20#

I hope this helps.

Pat...
patrick@stripped
CocoNet Corporation
SW Florida's First ISP


----- Original Message ----- 
From: "Peters, Sven" <sven.peters@stripped>
To: <mikeh@stripped>
Cc: <myodbc@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 
> i.e.
> Instead:
> 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 
> separately
>
> ______________________________
>
> Cheers
> Sven
>
>
> -----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'
>
> cheers
>
> mike
>
> Peters, Sven wrote:
>
>>Hi,
>>
>>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.
>>
>>Kind regards
>>Sven
>>
>>
>>
>>
>>
>
> -- 
> MySQL ODBC Mailing List
> For list archives: http://lists.mysql.com/myodbc
> To unsubscribe:    http://lists.mysql.com/myodbc?unsub=1
>
> 

Thread
Excel parameter-query with MyODBC and DateTime FieldSven Peters20 Jan
  • Re: Excel parameter-query with MyODBC and DateTime FieldMike Harknett20 Jan
AW: Excel parameter-query with MyODBC and DateTime FieldSven Peters21 Jan
AW: Excel parameter-query with MyODBC and DateTime FieldSven Peters21 Jan
  • Re: Excel parameter-query with MyODBC and DateTime FieldPatrick Sherrill21 Jan