OK, please start by verifying you can reproduce the problem directly with SQL Server.
Open Query Analyzer and point a query window at the correct DB. Then run this code:
Main Topics
Browse All TopicsI have a piece that sends out bday cards to patrons based on the data in a sql database. It has worked fine for several years. On july 30 it started giving the following error message:
System.Data.SqlClient.SqlE
at System.Data.SqlClient.SqlD
at System.Data.Common.DbDataA
at System.Data.Common.DbDataA
at System.Data.Common.DbDataA
at System.Data.Common.DbDataA
at System.Data.Common.DbDataA
at System.Data.Common.DbDataA
I have not changed the software and the data has not changed. The following is the sql select statement that is causing the error.
SELECT achDateOfBirth, achEmail, achName, lMealPlan
FROM tblStudent
WHERE (DATEPART(MM, achDateOfBirth) = DATEPART(mm, @sdate)) AND (LEN(achEmail) > 1) AND (DATEPART(dd, achDateOfBirth) = DATEPART(dd, @sdate))
AND (NOT (achDateOfBirth = N'1/1/1900'))
It is SQL Server 2000/2003
The last udate for the server stuff was jly 15, 2009, but there was an update for IE explorer on 7/30/2009
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
DanielWilson: I ran that in the analyzer and got the same response.
Server: Msg 8115, Level 16, State 2, Line 4
Arithmetic overflow error converting expression to data type datetime.
achDateOfBirth is nvarchar
acperkins: I tend to agree with you but the department that has control over my data says otherwise and I am trying to find a way to prove otherwise.
Sorry responses took so long had family emergency last night.
I strongly suspect you have some data that are not valid dates. Using IsDate:
http://msdn.microso
This does raise a 3rd possibility.
Business Accounts
Answer for Membership
by: aneeshattingalPosted on 2009-08-05 at 12:23:42ID: 25027062
i dont think this stament is causing the error