• I think I've sorted now thank you - Just finalising and I'll post details but I'm putting the payments and their row numbers in a second temp table and then using an update to marry up the temp invoices and temp payments