Menu

#3 unable submit article on nonUS system

open
nobody
None
5
2001-10-05
2001-10-05
Martin Vobr
No

Submiting article failed on post.asp line 216 column -
1 with error:

"Syntax error in date in query expression '#5.10.2001
1:53:56#'. "

Problem is probably caused by incorectly formated
date. My system is running czech locale, which uses
D.M.YYYY date format. MS Access SQL don't like it, it
needs M/D/YYYY.

You should write format all datetimes before inserting
into database. If you want you could use those simple
functions:

function DaoFormatDate(date)
DaoFormatDate = _
"#" & datepart("m",date) &_
"/" & datepart("d",date) &_
"/" & datepart("yyyy",date) &_
"#"
end function

function DaoFormatDateTime(date)
DaoFormatDateTime = _
"#" & datepart("m",date) &_
"/" & datepart("d",date) &_
"/" & datepart("yyyy",date) &_
" " & datepart("h",date) &_
":" & datepart("n",date) & _
":" & datepart("s",date) & _
"#"
end function

Discussion


Log in to post a comment.

MongoDB Logo MongoDB