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 [at] kiwiplan.co.nz]
Gesendet: Donnerstag, 20. Januar 2005 20:29
An: Peters, Sven
Cc: myodbc [at] lists.mysql.com
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=3Dgcdmo-myodbc [at] m.gmane.o rg
sven.peters [ Fr, 21 Januar 2005 09:24 ] [ ID #599491 ]

Re: Excel parameter-query with MyODBC and DateTime Field

Try wrapping your date with hash symbols as follows:
SELECT * from yourtable WHERE yourdatecolumn < #2005-01-20#

I hope this helps.

Pat...
patrick [at] coconet.com
CocoNet Corporation
SW Florida's First ISP


----- Original Message -----
From: "Peters, Sven" <sven.peters [at] coremedia.com>
To: <mikeh [at] kiwiplan.co.nz>
Cc: <myodbc [at] lists.mysql.com>
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 [at] kiwiplan.co.nz]
> Gesendet: Donnerstag, 20. Januar 2005 20:29
> An: Peters, Sven
> Cc: myodbc [at] lists.mysql.com
> 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=patrick [at] coconet.com
>
>


--
MySQL ODBC Mailing List
For list archives: http://lists.mysql.com/myodbc
To unsubscribe: http://lists.mysql.com/myodbc?unsub=gcdmo-myodbc [at] m.gmane.org
Patrick Sherrill [ Fr, 21 Januar 2005 14:24 ] [ ID #599930 ]
Datenbanken » gmane.comp.db.mysql.odbc » AW: Excel parameter-query with MyODBC and DateTime Field

Vorheriges Thema: Big trouble with odbc 3.51 connection.
Nächstes Thema: Catastrophic failure