C
conjured.illusions
I'm trying to get everything to run off of sql server, including this
module I made. Since I'm new at T-SQL I wanted to know if it was even
possible to do.
Here's the jist of my module
Do While Not .EOF
compare = rs.Fields(2)
cPerform = rs.Fields(0)
cEndTime = rs.Fields(1)
cArea = rs.Fields(4)
cTaskID = rs.Fields(5)
compDate = rs.Fields(6)
If compare <> initial And cPerform = iPerform And
cArea = iArea And cTaskID <> iTaskID And iDate = compDate Then
rs.MovePrevious
cEndTime = rs.Fields(1)
cTaskID = rs.Fields(5)
rs.Fields(3).Value = Round((DateDiff("s",
iStartTime, cEndTime) / 60), 0)
rs.Update
rs.MoveNext
initial = compare
iStartTime = cEndTime
compare = rs.Fields(2)
cPerform = rs.Fields(0)
cEndTime = rs.Fields(1)
cArea = rs.Fields(4)
iArea = rs.Fields(4)
cTaskID = rs.Fields(5)
iTaskID = rs.Fields(5)
iDate = compDate
compDate = rs.Fields(6)
There's a number of other ElseIf's but I didn't think anyone wanted to
parse through that mess. What I basically want to do is take a row
compare it to the one below it, and if certain requirements are met
then compare it to the row after and so on. If those requirements
aren't met then start the time calculation and reset the intial value
with the compared value and move to the next record. I'm sure its as
clear as mud, but without going into a long wided ordeal thats the
best I can do.
module I made. Since I'm new at T-SQL I wanted to know if it was even
possible to do.
Here's the jist of my module
Do While Not .EOF
compare = rs.Fields(2)
cPerform = rs.Fields(0)
cEndTime = rs.Fields(1)
cArea = rs.Fields(4)
cTaskID = rs.Fields(5)
compDate = rs.Fields(6)
If compare <> initial And cPerform = iPerform And
cArea = iArea And cTaskID <> iTaskID And iDate = compDate Then
rs.MovePrevious
cEndTime = rs.Fields(1)
cTaskID = rs.Fields(5)
rs.Fields(3).Value = Round((DateDiff("s",
iStartTime, cEndTime) / 60), 0)
rs.Update
rs.MoveNext
initial = compare
iStartTime = cEndTime
compare = rs.Fields(2)
cPerform = rs.Fields(0)
cEndTime = rs.Fields(1)
cArea = rs.Fields(4)
iArea = rs.Fields(4)
cTaskID = rs.Fields(5)
iTaskID = rs.Fields(5)
iDate = compDate
compDate = rs.Fields(6)
There's a number of other ElseIf's but I didn't think anyone wanted to
parse through that mess. What I basically want to do is take a row
compare it to the one below it, and if certain requirements are met
then compare it to the row after and so on. If those requirements
aren't met then start the time calculation and reset the intial value
with the compared value and move to the next record. I'm sure its as
clear as mud, but without going into a long wided ordeal thats the
best I can do.