You aren't using spaces between key words so one of your results will be PPE_LIST.PPE_LISTPermits = PermitsFROM
Get in the habit of having the space at the end or beginning of a line and be consistent with the choice. That should help.
This would likely be obvious if you also adopted the habit of printing the sql variable to the immediate window for review during testing or when it fails.
Last edited by Micron; 12-18-2019 at 09:36 AM.
Reason: clarification
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.