Hello everyone,

I'm having some trouble converting from cell values in excel to datetime in sql queries. BTW I'm using AdvantageDatabase and Excel 2010

Let's say I have a cell value D4 "12/12/2010"

Inside Microsoft query I have the following:
SELECT * FROM mytable WHERE mytable.Firstdate =?

Microsoft Query then gives me the option of choosing a cell. I choose D4. Normally this would work (it does with anything else, just not dates)

The AdvantageDatabase then throws back an error basically saying it cannot convert the excel value to datetime format. I have tried formatting the cell to every possible data value inside excel. I would like to make this happen without having to use macros or vb scripts. Is there some way to do this with an excel function or inside the sql query itself?

If not please help me with the appropriate vb script or macro.

also.... I checked the formatting of the table I'm trying to query in advantagedatabase. the column is setup with the date format and the column size is 4


Recommended Answers

All 2 Replies

If I read the post correctly you are using excel to query info out of mysql and having problems with the date. I think it might be due to excel storing the date in it's own format. Have you tried changing the sell type on excel to text and then entering the date so it stores it as a text string instead of a date format?

Thank you very much for the help... I found that my problem was that I was not using microsoft query correctly. I didnt have the paramters set up correctly. Thanks again

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.