I've used a similar method many times. All it takes is trashing a database once to learn the value of writing the where clause in a select statement before updating...
I recently had a similar issue with a scratch table. One of my predecessors had created a scratch table to perform intermediate sums and verify that in/out times added up...