Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ERROR 2147217913/conversion char to datetime/out of range 1

Status
Not open for further replies.

dobrowski

Programmer
Jun 1, 2001
9
US
The following proc is producing the runtime error 2147217913 - the conversion of char data type to a datetime data type resulted in an out of range datetime value.

if @LicenseIssueDate > convert(datetime,'11/30/' + convert(char(4),@LicenseYear))

Hardware: NT.40 sp6a server software: ms sql 7.0 sp2.

I scripted out a working copy of the whole database. Then went to another machine and ran the script, to create the database tables and proc's. This is the only problem that i ran into after i started using the newly created databse.
 

What is the value of @LicenseYear? Terry
------------------------------------
Blessed is the man who, having nothing to say, abstains from giving us worthy evidence of the fact. -George Eliot
 
@LicenseYear int,
@LicenseIssueDate datetime,


.Parameters("@LicenseYear") = CInt(Format(Now, "YYYY"))

.Parameters("@LicenseIssueDate") = Format(Now, "MM/DD/YYYY")
 
I checked the values of the parms

.Parameters("@LicenseYear") = 2001

.Parameters("@LicenseIssueDate") = 6/1/2001
 

Have you resolved the problem? I can't see anything syntactically wrong! Terry
------------------------------------
Blessed is the man who, having nothing to say, abstains from giving us worthy evidence of the fact. -George Eliot
 
No. I am thinking it is a machine error. NT error. We are reinstalling SQL on the machine now with sp1 and then sp2.

Any other ideas would be helpful.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top