Link to home
Start Free TrialLog in
Avatar of MitchellVII
MitchellVIIFlag for United States of America

asked on

Need help with importing Date() using parameterized query...

Hi,

I'm using a parameterized query to import a record from my MySQL Database into Access.  I want the date to be formatted as, "mm/dd/yy", but I'm not sure of the Constant to use in my .CreateParameter statement.  I tried this:

.Parameters.Append .CreateParameter(, adDBDate, adParamInput, , Format(Date, "mm/dd/yy"))

but that doesn't work since the format for adDBDate is "yyyy/mm/dd".

How can i do it?  It is important that I store the date in the format I specified.

Thanks!
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

DateTime columns are not stored in a format.  What matters is that it correctly knows the correct date and time value so that when retrieved it displays correctly in your application formatted as "mm/dd/yy".
ASKER CERTIFIED SOLUTION
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MitchellVII

ASKER

mw,

Yes, I would think so too, but its throwing me a "Type Mismatch" error.
Oops! (smacks head!).

It works, I just had two lines transposed.  Thanks!