If you get an error, please always tell us what the error said and on which line it occurred.
Fortunately your two bugs are obvious to me, so I can answer it even with such an insufficient description.
This is the right syntax:
while select crossCompany…