Asked By mah-skeet
16-Nov-09 12:30 PM

I have the following:
sqlstr = "SELECT Budgets.Cilcode, Budgets.[Cost Centre], Sum([Day]/60.0/8.0)
AS TSDays FROM (CIL.dbo.TIMEBIDTS INNER JOIN CIL.dbo.TIMEBIDUSERDEFTS ON
CIL.dbo.TIMEBIDTS.taskID = CIL.dbo.TIMEBIDUSERDEFTS.TaskID) INNER JOIN
CIL.dbo.Budgets ON CIL.dbo.TIMEBIDUSERDEFTS.BudgetID = CIL.dbo.Budgets.ID
WHERE (((TIMEBIDTS.Refdate)<'" &
MedDate(dateadd("m",1,request.form("RefDate"))) & "')) GROUP BY
Budgets.Cilcode, Budgets.[Cost Centre] HAVING (((Budgets.Cilcode)=" &
request.form("Cilcode") & ")) ORDER BY Budgets.[Cost Centre];"
rst.Open sqlstr, cnnSearch, 2,3
sqlstr2 = "SELECT CostCentre, TSDays FROM PMRResource WHERE CILCode=" &
request.form("Cilcode") & " and MonthID=" & request.form("MonthID") & " ORDER
BY CostCentre;"
rst2.Open sqlstr2, cnnSearch, 2,3
do while not rst2.eof
if rst2("CostCentre") = rst("Cost Centre") then
rst2("TSDays") = rst("TSDays")
if not rst.eof then
rst.movenext
end if
else
rst2("TSDays") = 0
end if
rst2.movenext
loop
I am getting the error on the line - "if rst2("CostCentre") = rst("Cost
Centre") then"
I do not know why becuase it works sometimes, but not others
Thanks in advance for the help.
Mark