Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Syntax error in sql server

Author  Topic 

hwoarang
Starting Member

14 Posts

Posted - 2008-04-25 : 03:38:24
hi anybody know what is meaning of "Syntax error converting datetime from character string" is data entry problem, tq

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-04-25 : 03:44:20
Are you trying to pass value for a datetime field? Its not able to convert value passed to a valid datetime value. That may be because the format of date sent is different from that set for server.use dateformat to set server format to your desired format before passing value

for ex:

SET DATEFORMAT dmy
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-04-25 : 04:18:56

declare @d datetime
set @d='112/2008'

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

hwoarang
Starting Member

14 Posts

Posted - 2008-04-25 : 21:36:03
this error msg occur at running time, so i don't sure is pass value for a datetime field, how i going to trace this error occur in which line of code by use query analyzer or is got other way to trace this error, tq
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-04-25 : 22:42:33
If it came from sp, query analyzer will tell you which line caued error.
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2008-04-28 : 04:54:04
add a datetime validation code in your front end so you don't get this error when passing to mssql

--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -