MitchellVII
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!
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!
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
mw,
Yes, I would think so too, but its throwing me a "Type Mismatch" error.
Yes, I would think so too, but its throwing me a "Type Mismatch" error.
ASKER
Oops! (smacks head!).
It works, I just had two lines transposed. Thanks!
It works, I just had two lines transposed. Thanks!