Solved

ODBC Error  8114  [Microsoft][ODBC SQL Server Driver][SQL Server]Error converting data type varchar to datetime.

Posted on 2011-03-14
2
1,613 Views
Last Modified: 2012-05-11
Having trouble passing a string which is converted to a date from an Access form to a SQL stored procedure.
Below is the function:

Call ParamSPT2(CDate(Forms!frmEPM_PROD!Text16))
0
Comment
Question by:psueoc
2 Comments
 
LVL 3

Accepted Solution

by:
Chadinzski earned 250 total points
ID: 35132329
Since the error appears to be generated from a call from Access to SQL, you might be able to wrap an
ON ERROR GOTO MyErrRoutine

That way you can put a break when the error occurs and check to see what text was passed.  It'd be helpful to know the string that caused the problem.
0
 
LVL 57

Assisted Solution

by:Raja Jegan R
Raja Jegan R earned 250 total points
ID: 35135344
>> Error converting data type varchar to datetime.

Kindly check the format of datetime you are getting as output from Access.
If it is some other format other than the default format / timezone set in SQL Server, then use appropriate CONVERT with appropriate styles so that string can be converted into datetime without any issues.
More on CONVERT and styles here:
http://msdn.microsoft.com/en-us/library/ms187928.aspx
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now