I am looking at some existing code and at the top of the code it creates a temp table usingCreate Table #tmpDriverTime(DriverName Varchar(53) ,EmployeeNo Int ,WorkDay1 Float ,WorkDay2 Float ,WorkDay3 Float ,WorkDay4 Float ,WorkDay5 Float ,WorkDay6 Float ,WorkDay7 Float ,WorkDay8 Float ,WorkDay9 Float ,Total6Day Float ,Total7Day Float ,Total8Day Float ,HrsAvailable Float ,StartDateTime DateTime Null ,EndDateTime DateTime Null ,Status Int Null ,DateWorked DateTime Null ,WorkDay1Status Int Null ,WorkDay2Status Int Null ,WorkDay3Status Int Null ,WorkDay4Status Int Null ,WorkDay5Status Int Null ,WorkDay6Status Int Null ,WorkDay7Status Int Null ,WorkDay8Status Int Null )
but later in the code there is an UPDATE statement with a WHERE condition I can not figure out.Update #tmpDriverTimeSet WorkDay7Status = @ResultWhere EmployeeNo = @DrvrIDAnd @PreviousIndex = 7
I know it is updating the Temp table to set the column WorkDay7Status to the value in the local varable @Result for the EmployeeNo equal to the value in @DrvrId. What I can't figure out is the second condition of @PreviousIndex = 7 part. There is no column of @PreviousIndex and looking at the code @PreviousIndex is a local variable of type INT. So how exactly does this second condition work?-- If I get used to envying others...Those things about my self I pride will slowly fade away.-Stellvia