473,396 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to format a date from a form for SQL server

I have retrieved a date from a form and the
Request.form("DOB") gives me the format of: 12/04/1976.

When I try to use SQL to add the record to the database, I get the error below.

Microsoft OLE DB Provider for SQL Server error '80004005'

Arithmetic overflow error converting expression to data type datetime.

The code generating the error is below:
oRs.Open "MailList", oC, adOpenKeySet, adLockPessimistic, adCmdTable

' Add a new record
oRs.AddNew
oRs("DOB")= DOB
' Update the record
oRs.Update

I need to know how to format the date variable so the database can be updated.
Thanks,
Dave
Jan 3 '12 #1
1 1420
ck9663
2,878 Expert 2GB
Your date value is valid as far as your front-end app is concern. Check the setting of your server if it's set to accept a mm/dd/yyyy formatted date. If all seems well, then you have another problematic column, not the DOB.

Happy Coding!!!


~~ CK
Jan 4 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: wireless | last post by:
In our database is a decimal field with format YYMMDDhhmmss.9999999999 where the 9s are random digits. I'm trying to strip off just the YYMMDD and put it in date form. So far I came up with:...
2
by: amith | last post by:
hi I have written javascript for comparing two dates in US format and finding out whether the start date is greater than the end date and vice versa. In this attempt i have instantiated the...
4
by: peashoe | last post by:
I have an asp page that uses a calendar.js (pop-up) file to add an exact date format in the text field (txtDDate). My problem is I need some javascript that sets an alert that does not allow them...
0
by: lsy | last post by:
i wonder how can i order my statement interm of "ORDER BY FORMAT(Date, 'mmmm')" with using this it will order by alphabethical but i want it order by month... i had try "ORDER BY FORMAT(Date, 'mm')"...
1
by: Kerri | last post by:
Hi, I am new to .NET. I have a server side text box on an ASPX Page. I want to format the date when the user tabs out / double clicks teh textbox or presses carriage retutrn. What event do...
4
by: Wayne Wengert | last post by:
I have an aspx page in which I retrieve data from an SQL Server. At one point I am retrieving a smalldatetime field and I want to display only "mm/dd/yy" but the default seems to be to add the...
1
by: G Gerard | last post by:
Hello I am having some problem comparing dates with the SQL statement below MySQL = "SELECT Format(Date, 'yyyy/mmmm/dd') as FROM TblDates WHERE _ Format(Date, 'yyyy/mmmm/dd') =...
1
by: shyam vashista | last post by:
i have problem in validation check for system date with server date problem::: If i change my system date as september 30, 2006 and use validation for filling form as current date as oct30,...
5
mgpsivan
by: mgpsivan | last post by:
Hi, i have form in Asp.net(2003) in that i've to change the format of the date by the following statement Format(Date.Today, "dd/mm/yyyy") but when i give this code the month part displays as...
2
omerbutt
by: omerbutt | last post by:
hi i need to store the date in the format date('YmdGis') the problem is that locally it is working perfect but when i go live it stops storing the date in this format , although it does store the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.