gnom
06-12-2005, 09:14 PM
I wrote an ASP script, which displays a form and then put taken data into a ACCESS database; one of it's field is 'date' of data/time type.
The problem occures bedause ASP script changes without no reason the date's format common for my Access database (yyyy-mm-dd) to some (mm/dd/yyyy) and moreover very often with a wrong values.
Part of my script, where all variables with letter f at the begining are fields of the form:
fdate = "'" & fyear & "-" & fmonth & "-" & fday & "'"
Response.write(fyear & "-" & fmonth & "-" & fday & "<br>")
Response.write(fdate & "<br>")
query = "INSERT INTO Game values (" & maxid & "," & date & "," & ftwith & "," & ftagainst & "," & fstadium & "," & ftype & "," & freferee & "," & fwithscore & "," & fagainstscore & ")
Response.write(query & "<br>")"
gives the output:
2003-12-12
'2003-12-12'
INSERT INTO Game values (9,6/12/2005,1,3,3,'friendly',4,1,8)
What is that 6/12/2005?? When I execute that query I get a new row but with year 1809!?! :confused:
I tried to put the date between ' characters (as is above) and without them....
Can anyone tell me what I'm dooing wrong?
The problem occures bedause ASP script changes without no reason the date's format common for my Access database (yyyy-mm-dd) to some (mm/dd/yyyy) and moreover very often with a wrong values.
Part of my script, where all variables with letter f at the begining are fields of the form:
fdate = "'" & fyear & "-" & fmonth & "-" & fday & "'"
Response.write(fyear & "-" & fmonth & "-" & fday & "<br>")
Response.write(fdate & "<br>")
query = "INSERT INTO Game values (" & maxid & "," & date & "," & ftwith & "," & ftagainst & "," & fstadium & "," & ftype & "," & freferee & "," & fwithscore & "," & fagainstscore & ")
Response.write(query & "<br>")"
gives the output:
2003-12-12
'2003-12-12'
INSERT INTO Game values (9,6/12/2005,1,3,3,'friendly',4,1,8)
What is that 6/12/2005?? When I execute that query I get a new row but with year 1809!?! :confused:
I tried to put the date between ' characters (as is above) and without them....
Can anyone tell me what I'm dooing wrong?