Wow, was really fast.
Thank you for that Ruben, but still not working.
Do while dia<=2
left join (ANALISE_TMP)
VALUE_READ * TYPE_CONSTANT AS CONSUMODIA$(dia)
ORDER BY OID_METER,DATE_READ DESC;
I get the same error as before