sql怎样用插入当前时间?
sql里有一个time类型是datetime
我用now()想在SQL里插入一条当前时间的数据
<%
dim objconn
dim sprs
set objconn = server.CreateObject( "adodb.connection ")
set sprs=server.CreateObject( "adodb.recordset ")
objconn.connectionstring = "driver={sql server}; " _
& "server=ROBBER;uid=lgw " _
& ";pwd=1230;database=Data "
objconn.open
set sprs=objconn.execute( "update users set time= "&now()& " ")
%>
但插入不了,因为now()返回时间为2007-04-16 上午 08:12:25,而datetime可以保存的格式却为2007-04-16 AM 08:12:25
请问怎样把中间的上午转为AM?或者怎样插入当前时间?
麻烦最好给出例子,因为小弟笨,刚学,谢谢了,送分!
------解决方案--------------------....楼主笨
now()改为getdate()
set sprs=objconn.execute( "update users set time= "getdate " ")