I am trying to check that a table has a certain value in it (-1) before it continues with the load process. If the table does not have the required value then the process loops and tries 3 more times. The issue I have is the any function does not work after the 'then' statement. There is a red squiggle line below the text after the 'then' statement and the load fails (Script line error).
for i = 1 to 3 Load_temp: loadActive //field name that should contain at least one -1 value ; SQL SELECT Active FROM [PJB_ED].dbo.[tbl_PJB_ED_Data] Where ArrivalDate > DATEADD(dd, DATEDIFF(dd, +2, getdate()), 0) and Active = -1 and left(RoomBed,4) <> 'XRay' ; ifNoOfRows('Load_temp') <> 0 then exit for; // This line is where the problem is - after then 'then' statement anything gets red squiggle line