Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 16th, 2007, 06:30 AM
Authorized User
 
Join Date: May 2007
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Default datatype

hi
iam geting error in running sql :

runtime error 2147217913(800040E07)

convertion of char datatype to smalldatetime datatype resulted in out of range samlldatetime value.

please help....
my sql is:

rs.Open "Select * from t_indent_det Where Indent_no = '" & ind_det.indent_no & "' and item_code = '" & ind_det.item_Code & "' and gsm = '" & ind_det.GSM & "' And S_Length = " & ind_det.S_LENGTH & " And S_Breath = " & ind_det.S_Breath & " And G_Direction = '" & ind_det.G_Direction & "' and Reel_od = " & ind_det.Reel_OD & " and mfg_code = '" & ind_det.mfg_code & "' and Core_ID = " & ind_det.Core_ID & " and Schedule_date= '" & ind_det.shedule_date & "'", dbconn, adOpenKeyset, adLockOptimistic


 
Old May 16th, 2007, 10:11 AM
Authorized User
 
Join Date: Oct 2005
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Based on the error message, one of your columns in your WHERE clause is of smalldatetime data type and the value you are trying to compare to it is either before January 1, 1900 or after June 6, 2079, which are the limits of a smalldatetime data type. Another possible cause of this error is passing an invalid date like '02/29/2007' or '06/31/2007'.

SQL Server Helper
How well do you know SQL? Find out with the free test assessment from SQL Server Helper!!!
http://www.sql-server-helper.com/free-test/default.aspx

Got a SQL Server Question? Ask us here: http://www.sql-server-helper.com/forums/default.asp
 
Old May 16th, 2007, 11:56 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
quote:convertion of char datatype to smalldatetime datatype resulted in out of range samlldatetime value.
To me it looks like it is because the server accepts the datetime to be of mm/dd/yyyy as default format, and the value being processed is of dd/mm/yyyy format that causes this error.

Cheers.

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Datatype rain_uk SQL Server ASP 2 July 5th, 2005 01:34 AM
DataType Validation Baby_programmer ASP.NET 1.0 and 1.1 Basics 0 October 30th, 2004 08:00 PM
DataType Conversion using WHERE IN ( ) Colonel Angus SQL Language 3 August 18th, 2004 07:43 AM
How Could I use C APIs with different DataType?? 6cet6 VS.NET 2002/2003 0 March 24th, 2004 09:20 PM
datatype ngang SQL Language 1 November 18th, 2003 09:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.