4 felter som identificerer ID ( Log Date, JLTO, JLJOB , JLKEY ) 3 felter som skal opdateres ( # Log, Latest Log, Change Date ) 19 felter som er event som afhængig om event er indtruffet indeholder en dato eller er blank
Event er identifideret som en statusændring, eksempel : 1 > 3 1 > 4 1 > B ....
Feltet # Log skal opdateres med antal events for record Feltet Change Date skal opdateres med dato for seneste event Feltet Latest Log skal opdateres med hvilken ehent der er den seneste
Jeg kan godt sende et eksempel hvis det bliver nødvendigt
Public Function Maximum(ParamArray MyArray()) As Variant
Dim intLoop As Long Dim intColumn As Long
Maximum = Null intColumn = 0 For intLoop = LBound(MyArray) To UBound(MyArray)
If IsNull(MyArray(intLoop)) Then 'do nothing ElseIf IsNull(Maximum) Then Maximum = MyArray(intLoop) intColumn = intLoop + 1 ElseIf MyArray(intLoop) > Maximum Then Maximum = MyArray(intLoop) intColumn = intLoop + 1 End If
Next End Function
Public Function Column(ParamArray MyArray()) As Variant
Dim intLoop As Long Dim intColumn As Long
Column = Null intColumn = 0 For intLoop = LBound(MyArray) To UBound(MyArray)
If IsNull(MyArray(intLoop)) Then 'do nothing ElseIf IsNull(Column) Then Column = MyArray(intLoop) intColumn = intLoop + 1 ElseIf MyArray(intLoop) > Column Then Column = MyArray(intLoop) intColumn = intLoop + 1 End If
Next Select Case intColumn Case 1 Column = "1 > 3" Case 2 Column = "1 > 4" Case 3 Column = "1 > 5" Case 4 Column = "1 > B" Case 5 Column = "3 > B" Case 6 Column = "4 > 1" Case 7 Column = "4 > 3" Case 8 Column = "4 > 5" Case 9 Column = "4 > B" Case 10 Column = "4 > D" Case 11 Column = "5 > 1" Case 12 Column = "5 > 3" Case 13 Column = "5 > 4" Case 14 Column = "5 > B" Case 15 Column = "5 > D" Case 16 Column = "W > 1" Case 17 Column = "W > 3" Case 18 Column = "W > 4" Case 19 Column = "W > 5" End Select End Function
Public Function Number(ParamArray MyArray()) As Variant
Dim intLoop As Long Dim intNumber As Long
Number = Null intNumber = 0 For intLoop = LBound(MyArray) To UBound(MyArray)
If IsNull(MyArray(intLoop)) Then 'do nothing ElseIf IsNull(Number) Then Number = MyArray(intLoop) intNumber = intNumber + 1 ElseIf MyArray(intLoop) > Number Then Number = MyArray(intLoop) intNumber = intNumber + 1 End If
Next Number = intNumber End Function
....Jeg har ikke optimeret paa det.... men det er sikkert fint.
Public Function Maximum(ParamArray MyArray()) As Variant
Dim intLoop As Long Dim intColumn As Long
Maximum = Null For intLoop = LBound(MyArray) To UBound(MyArray)
If IsNull(MyArray(intLoop)) Then 'do nothing ElseIf IsNull(Maximum) Then Maximum = MyArray(intLoop) ElseIf MyArray(intLoop) > Maximum Then Maximum = MyArray(intLoop) End If
Next End Function
Public Function Column(ParamArray MyArray()) As Variant
Dim intLoop As Long Dim intColumn As Long
Column = Null intColumn = 0 For intLoop = LBound(MyArray) To UBound(MyArray)
If IsNull(MyArray(intLoop)) Then 'do nothing ElseIf IsNull(Column) Then Column = MyArray(intLoop) intColumn = intLoop + 1 ElseIf MyArray(intLoop) > Column Then Column = MyArray(intLoop) intColumn = intLoop + 1 End If
Next Select Case intColumn Case 1 Column = "1 > 3" Case 2 Column = "1 > 4" Case 3 Column = "1 > 5" Case 4 Column = "1 > B" Case 5 Column = "3 > B" Case 6 Column = "4 > 1" Case 7 Column = "4 > 3" Case 8 Column = "4 > 5" Case 9 Column = "4 > B" Case 10 Column = "4 > D" Case 11 Column = "5 > 1" Case 12 Column = "5 > 3" Case 13 Column = "5 > 4" Case 14 Column = "5 > B" Case 15 Column = "5 > D" Case 16 Column = "W > 1" Case 17 Column = "W > 3" Case 18 Column = "W > 4" Case 19 Column = "W > 5" End Select End Function
Public Function Number(ParamArray MyArray()) As Variant
Dim Number2 As Variant Dim intLoop As Long Dim intNumber As Long
Number = Null Number2 = Null intNumber = 0 For intLoop = LBound(MyArray) To UBound(MyArray)
If IsNull(MyArray(intLoop)) Then 'do nothing ElseIf IsNull(Number2) Then Number2 = MyArray(intLoop) intNumber = intNumber + 1 ElseIf MyArray(intLoop) > Number2 Then Number = MyArray(intLoop) intNumber = intNumber + 1 Else intNumber = intNumber + 1 End If
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.