garethtnash
asked on
Microsoft OLE DB Provider for SQL Server error '80040e07'
Hi there,
I'm getting the following error on a submit page asp -
Microsoft OLE DB Provider for SQL Server error '80040e07'
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
/checkout.asp, line 179
the data that is being sent is in dd/mm/yyyy format, when I try and change the code on the page I get another error, so ideally as a short term I would like to capture this and do the conversion on the database (ms sql) anyway of doing this?
thanks
I'm getting the following error on a submit page asp -
Microsoft OLE DB Provider for SQL Server error '80040e07'
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
/checkout.asp, line 179
the data that is being sent is in dd/mm/yyyy format, when I try and change the code on the page I get another error, so ideally as a short term I would like to capture this and do the conversion on the database (ms sql) anyway of doing this?
thanks
ASKER
is there a way to change this code -
<input type="text" value="dd/mm/yy" onfocus="this.select();lcs (this)" onclick="event.cancelBubbl e=true;thi s.select() ;lcs(this) ">
So that it inputs like -
October 24 2008 ?
Thanks
<input type="text" value="dd/mm/yy" onfocus="this.select();lcs
So that it inputs like -
October 24 2008 ?
Thanks
i am not sure if i understand what are you trying to say but
you could use 3 dropdown menus with days, months, years
let user select the date
myStr= request.form("month") & "/" & request.form("day") & "/" & "/" & request.form("year")
and use cDate(myStr) that you send to mssql.
you could use 3 dropdown menus with days, months, years
let user select the date
myStr= request.form("month") & "/" & request.form("day") & "/" & "/" & request.form("year")
and use cDate(myStr) that you send to mssql.
I would recommend using either a date picker control or seperate combo's for each date part.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
But...as a warning, the other commenters are correct...handling date formats by the time it gets to SQL can be quite fragile. Your interface really should handle all the formatting issues, and once you are submitting your data to SQL everything should be *strongly* typed.
ASKER
thank you
Hope that helps