Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

conversion error ????

Status
Not open for further replies.

gvision

Programmer
Nov 20, 2001
14
FR
I'm trying to run an sql query in an asp page.
Here's my query :

var sqlQuery = "insert into reparateurs (OBSERVATIONS, [Cazan OU Microlease], [Date Cde Microlease], [Date Inst Microlease], PHOTOS, [DATE AGREE], [NOM DU RESEAU]) values('" + observations + "', '" + cazanoumicrolease + "', '" + datecdemicrolease + "', '" + dateinst + "', '" + photo + "', dateagree + "', '" + nomreseau + "')" ;

[DATE AGREE] is a datetime field.

This gives the error message : The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.

Could anyone help me. Thank you
 
Its a bit hard to distinguish the single quotes from the double, but it seems to my 20/400 vision that you might be missing a quote at the beginning of dateagree. --------------
Low Cost Prints:
 
Hi,

Try this

var sqlQuery = "insert into reparateurs (OBSERVATIONS, [Cazan OU Microlease], [Date Cde Microlease], [Date Inst Microlease], PHOTOS, [DATE AGREE], [NOM DU RESEAU]) values('" + observations + "', '" + cazanoumicrolease + "', '" + datecdemicrolease + "', '" + dateinst + "', '" + photo + "','" + dateagree + "', '" + nomreseau + "')" ;

I think u missed some " in the SQL string

Sunil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top