技術(shù) 點(diǎn)
- 技術(shù)
- 點(diǎn)
- V幣
- 點(diǎn)
- 積分
- 1057
|
Public Function abc()
On Error GoTo Err_Cmdls_Click
CurrentDb.Execute "update 電視劇整理 set 臨時(shí)=''"
Dim Rs As New ADODB.Recordset
Dim date1 As Date
Dim date2 As Date
Dim str1 As String
Dim str2 As String
Dim xx1 As String
Dim xx2 As String
Dim mc1 As String
Dim mc2 As String
Rs.Open "電視劇整理", CurrentProject.Connection, adOpenKeyset, adLockOptimistic, adCmdTable
Rs.MoveFirst
CurrentDb.Execute "update 電視劇整理 set 臨時(shí)=名稱 "
Do Until Rs.EOF
str1 = Rs!臨時(shí)
date1 = Rs!開始日期
xx1 = Rs!合并
mc1 = Rs!名稱
Rs.MoveNext
mc2 = Rs!名稱
xx2 = Rs!合并
date2 = Rs!開始日期
If xx1 = xx2 And date2 - date1 > 10 Then
str2 = str1 + "-重"
Rs!臨時(shí) = str2
ElseIf xx1 = xx2 And date2 - date1 <= 10 Then
Rs!臨時(shí) = str1
Else
Rs!臨時(shí) = mc2
End If
Loop
Rs.Close
Set Rs = Nothing
Exit_Cmdls_Click:
Exit Function
Err_Cmdls_Click:
If err.Number = 3021 Then
MsgBox "結(jié)果已經(jīng)生成!", vbInformation, "提示:"
Resume Exit_Cmdls_Click
End If
MsgBox err.Description & err.Number
Resume Exit_Cmdls_Click
End Function |
|