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,657 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

'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 …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

816 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

11 Experts available now in Live!

Get 1:1 Help Now