Solved

SQLDateTime overflow Delete issue?

Posted on 2009-07-02
10
256 Views
Last Modified: 2012-05-07
I receive the error: "SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM" when attempting to delete a record in my backend sql server 2005 database??
0
Comment
Question by:Shepwedd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 3
  • +1
10 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 24763616
datetime wont support upto 9999 use value upto 2049-12-31
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 24763668
sorry , mymistake it supports   January 1, 1753, through December 31, 9999..  seems like your database constain values that are out of range
0
 
LVL 41

Expert Comment

by:ralmada
ID: 24763678
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 200 total points
ID: 24763684
SELECT *
FROM urTable
WHERE  ISDATE(urDateColumn) = 0
0
 

Author Comment

by:Shepwedd
ID: 24764121
aneeshattingal,

Do you want me to run your query on my table?
0
 

Author Comment

by:Shepwedd
ID: 24764178
No results are returned when I run your query.

I am setting the time value as well as the date value of my column if this causes an issue?
0
 

Author Comment

by:Shepwedd
ID: 24764200
...and the time is being set in 24hr, i.e. a typical value that I'm wanting to delete is 15/07/2009 15:00:00. But obviously it's not being deleted as I get the error.
0
 
LVL 41

Assisted Solution

by:ralmada
ralmada earned 150 total points
ID: 24764258
The problem is not in your table but in the code you're passing from ASP. Have you checked the link I've suggested above?
 
http://forums.asp.net/t/1134244.aspx 
Here's another one:
http://p2p.wrox.com/asp-net-3-5-basics/73673-sqldatetime-overflow.html 
0
 
LVL 57

Assisted Solution

by:Raja Jegan R
Raja Jegan R earned 150 total points
ID: 24764386
What is the datatype of that column either datetime or smalldatetime?

smalldatetime wont support that value. It supports till 06-06-2079 only.

aneesh,
    SELECT *
FROM urTable
WHERE  ISDATE(urDateColumn) = 0

This will work fine for both datetime and smalldatetime.

Shepwedd,
   Can you kindly confirm this one
0
 
LVL 41

Expert Comment

by:ralmada
ID: 24764645
 

I still think the problem is not in the table. If I understood correctly he's trying to delete a record, so the record is already in the table and is valid date. i.e. doing a select with ISDATE will not return any records because the table contains valid dates.

I feel the problem is with the parameter being received from ASP. Probably the asker is sending a '01/01/0001' date which is not supported in SQL. Again, have a look at the links I've suggested.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

623 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