|
各位老师请帮助看看下面的代码如何修改一下:
表: tblWACO里面的字段为short Text格式,现在想修改为Number格式,请问下面的代码如何调整,谢谢
Function allln(CO As String, 子项 As String, Actuator_date As Date, TEXT_No As String) As String
Dim rs As New ADODB.Recordset '定义一个ado数据集
Dim ssql As String
Dim i As Long
Dim str As String
ssql = "SELECT co,ln,子项,Actuator_date,TEXT_No FROM tblWACO "
ssql = ssql & "WHERE co='" & CO & "' and 子项='" & 子项 & "'and Actuator_date=#" & Actuator_date & "# and TEXT_No='" & TEXT_No & "' "
rs.Open ssql, CurrentProject.Connection, adOpenKeyset, adLockOptimistic '打开一个数据集
For i = 1 To rs.RecordCount
str = str & rs!LN.Value & "," '循环拼接字符串
rs.MoveNext
Next
allln = Left(str, Len(str) - 1) '去掉尾部逗号后作为函数的返回值
rs.Close
Set rs = Nothing
End Function
|
|