VB 执行sql语句,语句中在套SQL语句
strSQL1="updatetelephone_"&frmCATI.labItemID.Caption&"setstate='已完成'whereRecordid="&C...
strSQL1 = "update telephone_" & frmCATI.labItemID.Caption & " set state = '已完成' where Recordid = " & CLng(frmCATI.labRecordID.Caption)
'设置telephone
strSQL0 = "select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':','')"
strSQL2 = "update telephone_" & frmCATI.labItemID.Caption & " set calldate =***********这里我如何得到strSQL0的时间****************
strSQL3 = "update telephone_" & frmCATI.labItemID.Caption & " set callstate = '" & Trim(CStr(iState)) & "',"
strSQL3 = Mid(strSQL3, 1, Len(strSQL3) - 1)
strSQL3 = strSQL3 & " where RECORDID = " & CLng(frmCATI.labRecordID.Caption)
conn.Execute strSQL0
conn.Execute strSQL1
conn.Execute strSQL2
conn.Execute strSQL3 展开
'设置telephone
strSQL0 = "select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':','')"
strSQL2 = "update telephone_" & frmCATI.labItemID.Caption & " set calldate =***********这里我如何得到strSQL0的时间****************
strSQL3 = "update telephone_" & frmCATI.labItemID.Caption & " set callstate = '" & Trim(CStr(iState)) & "',"
strSQL3 = Mid(strSQL3, 1, Len(strSQL3) - 1)
strSQL3 = strSQL3 & " where RECORDID = " & CLng(frmCATI.labRecordID.Caption)
conn.Execute strSQL0
conn.Execute strSQL1
conn.Execute strSQL2
conn.Execute strSQL3 展开
1个回答
展开全部
vb有自己获取时间的 api
用 now
或者timer 控件
赋值给参数然后再 连接就可以 没必要这样
用 now
或者timer 控件
赋值给参数然后再 连接就可以 没必要这样
更多追问追答
追问
因为有几百个电脑,为了实现时间统一,我也没办法,能帮帮忙吗?
追答
vb中可以这样写
Private Sub Command1_Click()
Static nflag As Boolean
If nflag = False Then
Command1.Caption = "十二小时制"
nflag = True
Else: Command1.Caption = "二十四小时制"
nflag = False
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Timer1_Timer()
Form1.Caption = Now
Label10.Caption = Year(Now)
Label11.Caption = Month(Now)
Label12.Caption = Day(Now)
If Command1.Caption = "十二小时制" Then
Label4.Caption = Hour(Now)
Else: Label4.Caption = Hour(Now) Mod 12
End If
Label5.Caption = Minute(Now)
Label6.Caption = Second(Now)
End Sub
如果非要sql
strSQL2 = "update telephone_" & frmCATI.labItemID.Caption & " set calldate =‘ (select replace(replace(replace(CONVERT(varchar, getdate(), 120 ),'-',''),' ',''),':',''))' "
直接 写成一个sql
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询