Query Data using Date

From: wira659 (wira659_at_discussions.microsoft.com)
Date: 02/27/05


Date: Sat, 26 Feb 2005 21:57:02 -0800

I using Windows XP SP2. Install SQL Server 2000 Developer Edition.

I want to query a table which contains a column of data type datetime using
ASP form, where the input of type text. Before querying I cahnge input text
into date format using CDate() function.

When I run the query I got this message:

 "Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
[Microsoft][ODBC SQL Server Driver][SQL Server]The conversion of a char data
type to a datetime data type resulted in an out-of-range datetime value.
"

I have another Machine Installed with Windows 2000 Pro, SQL Server 2000
Developer Ed. When I ran the same query It works.

Wish to know what is the problem?



Relevant Pages

  • Date frustration
    ... Initially I setup my dates in a varchar field, now I need them in a datetime ... This query will not successfully run, giving me this error, ... The conversion of a char data type to a datetime data type resulted in an ...
    (microsoft.public.sqlserver.programming)
  • Re: Problems formatting Date in a listBox
    ... > the Field is datetime ... Is this from the same query being executed from the VB code? ... problem with the data type of the database column. ...
    (microsoft.public.vb.database.ado)
  • Re: Number to Date.
    ... --you write a query to make conversion to datetime as follows. ... Make use of datetime datatype instead to avoid datetime value overflow errors and to insert ... The conversion of a char data type to a datetime data type resulted in an out-of-range ...
    (microsoft.public.sqlserver.mseq)
  • Re: Dates
    ... I have never ever had any problems with a date in ISO 8601 format. ... The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. ... System.Data.Common.DbDataAdapter.FillFromReader(Object data, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) +260 ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Dates
    ... Create SqlParameter objects for the parameters and add them to the Parameters collecion of the command. ... The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. ... System.Data.Common.DbDataAdapter.FillFromReader(Object data, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) +260 ...
    (microsoft.public.dotnet.framework.aspnet)