Solved

SQLDateTime overflow Delete issue?

Posted on 2009-07-02
10
212 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
  • 3
  • 3
  • 3
  • +1
10 Comments
 
LVL 75

Expert Comment

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

Expert Comment

by:Aneesh Retnakaran
Comment Utility
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
Comment Utility
0
 
LVL 75

Accepted Solution

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

Author Comment

by:Shepwedd
Comment Utility
aneeshattingal,

Do you want me to run your query on my table?
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:Shepwedd
Comment Utility
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
Comment Utility
...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
Comment Utility
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
Comment Utility
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
Comment Utility
 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now