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!
LVL 5
MitchellVIIAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kevin CrossChief Technology OfficerCommented:
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".
0
Kevin CrossChief Technology OfficerCommented:
So this should be fine:
.Parameters.Append .CreateParameter("{paramName}", adDBDate, adParamInput, , Format(Date, "yyyy/mm/dd"))
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MitchellVIIAuthor Commented:
mw,

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

It works, I just had two lines transposed.  Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.