Office中国论坛/Access中国论坛

标题: 求教sql中日期格式问题 [打印本页]

作者: djhong    时间: 2006-8-24 03:24
标题: 求教sql中日期格式问题
为何不能更新表中日期.每次提示"标准表达式中数据类型不匹配"

表中日期格式为"yyyy-mm-dd"

Dim str As String
Dim rs As New ADODB.Recordset
Me.联系日期 = Date
   str = "update [表] set [表].日期 ='" & Me.日期 & " ' where [表].id = '" & Me.id & "'"

ExecuteSQL (str)
作者: djhong    时间: 2006-8-24 03:25
为何不能更新表中日期.每次提示"标准表达式中数据类型不匹配"

表中日期格式为"yyyy-mm-dd"

Dim str As String
Dim rs As New ADODB.Recordset
Me.日期 = Date
   str = "update [表] set [表].日期 ='" & Me.日期 & " ' where [表].id = '" & Me.id & "'"

ExecuteSQL (str)
作者: Benjamin_luk    时间: 2006-8-24 04:51
Dim str As String
Dim rs As New ADODB.Recordset
Me.日期 = Date
   str = "update [表] set [表].日期 =#" & Me.日期 & " # where [表].id = '" & Me.id & "'"

ExecuteSQL (str)[em01]
作者: 09121390    时间: 2009-11-26 23:37
好   学习了




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3