Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2009-07-15
4
Medium Priority
?
249 Views
Last Modified: 2013-11-27
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!
0
Comment
Question by:MitchellVII
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 24861727
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
 
LVL 60

Accepted Solution

by:
Kevin Cross earned 2000 total points
ID: 24861733
So this should be fine:
.Parameters.Append .CreateParameter("{paramName}", adDBDate, adParamInput, , Format(Date, "yyyy/mm/dd"))
0
 
LVL 5

Author Comment

by:MitchellVII
ID: 24861849
mw,

Yes, I would think so too, but its throwing me a "Type Mismatch" error.
0
 
LVL 5

Author Closing Comment

by:MitchellVII
ID: 31603850
Oops! (smacks head!).

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

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question