Without seeing the original it's hard to say what might have been wrong. However, I use the method in your screenshot (or using Append) because it's easier to read & therefore easier to debug.

I actually prefer using Append because you don't need the ) at the end & when the SQL code contains ), it's easier to debug:

Code:
        Move         "Update Lease " to sSQL
        Append sSQL " join arli on arli.Lease = lease.`code` "
        Append sSQL " join invoiceBatchDetail on InvoiceBatchDetail.InvoiceNum = arli.invoice "
        Append sSQL " Set lease.hist_act_hr_eh = lease.actual_hours_eh, "
        Append sSQL "     lease.trl_hr_bill_eh = (trl_hr_bill_eh + lease.HOLD_HR_BILL_EH), "
        Append sSQL "     lease.actual_hours_eh  = 0, "
        Append sSQL "     lease.last_eh_inv_dte = arli.Period_End, "
        Append sSQL "     lease.hold_eh_inv_dte = '0000-00-00', "
        Append sSQL "     lease.changeddate     = now(), "
        Append sSQL "     lease.changedby       = '" sUser "'"
        Append sSQL " where InvoiceBatchDetail.BatchID = " (String(iBatch))
        Append sSQL " and (Lease.Use_Actual_Read = 'Y' and lease.ACTUAL_hours_eh <> 0) and lease.hourly_rate_eh <> 0;"