ACCESS数据库
datetime为“日期/时间”类型字段
SQL语句为:update news set datetime=#2005-6-14 14:57:39# where id =1
这样报错,插入日期也出错,我只能在ACCESS里面定义这个字段的默认值为“now()”了,但现在涉及到修改这个字段的操作,怎么弄都报错:(
...全文
1964打赏收藏
SQL语句怎么操作日期类型字段的数据?
ACCESS数据库 datetime为“日期/时间”类型字段 SQL语句为:update news set datetime=#2005-6-14 14:57:39# where id =1 这样报错,插入日期也出错,我只能在ACCESS里面定义这个字段的默认值为“now()”了,但现在涉及到修改这个字段的操作,怎么弄都报错:(
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] UPDATE 语句的语法错误。
/mjw/mjw_admin/news_up.asp, 第 14 行
源代码:
<%@ LANGUAGE="VBSCRIPT"%>
<!--#include file="inc_top.asp"-->
<!--#include file="inc_news.asp"-->
<%
'sql = "select top 1 id from news order by id desc"
'set a = dbcon.Execute(sql)
'Response.write(a("id"))
sql = "update news set datetime='#"&now()&"#' where id="&request.QueryString("id")
Response.write(sql)