Este comando esta dando erro me ajuda fazendo favor

___________________________________________

let RG_Nr := (select ‘1_Client Orders’)[‘Invoice No.’ like format(today(), “YYMMDD”)].‘Invoice No.’;

let mytodayNr := number(max(RG_Nr));

if number(RG_Nr) < 1807030001 then

‘Invoice No.’ := text(“B_” + number(format(today(), “YYMMDD”)) + “0001”)

else

‘Invoice No.’ := text(number(mytodayNr + 1))

end