I wasn’t too sure what to name the subject line for this question.
I am trying to run a query within a FOR loop
and every time it comes through here, I am not returning the correct results because something
FOR x in range(1,6):
x=str(x)
query1 = "SELECT BatchID FROM Reports WHERE TempZone"+ x + " = NULL"
batchID = system.db.runScalarQuery(query1)
The problem is the indirect column named TempZone1-5
Does anyone know a way around this?
I’ve already tried
system.db.runScalarQuery("Select BatchID From Reports Where TempZone%s = NULL" %x)
It didn’t work either.