Screen with error in displaying the data, sql code does not work

this page has an error when pressing the money button to consult, I have sql code but it is not working properly

sql code used:

e.nomeEvento,p.nomecompl,c.nomecasa, COALESCE(l.observacao,'Sem informação') AS `observacao`, CONCAT('R$ ',REPLACE(REPLACE(REPLACE(FORMAT(IFNULL(l.valorExtornado, 0), 2), ".", "@"), ",", "."), "@", ",")) AS `valorExtornado`,
l.idpart, l.parcela, AS idParticipante, DATE_FORMAT(l.datavcto, '%d/%m/%Y') AS `dataVcto`,
CONCAT('R$ ',REPLACE(REPLACE(REPLACE(FORMAT(l.valor, 2), ".", "@"), ",", "."), "@", ",")) AS `valorDevido`,
IF(l.datapgto IS NULL,'danger','success') AS `pagoCSS`,
IF(l.datapgto IS NULL,'Pendente','Pago') AS `pago`,
IFNULL(DATE_FORMAT(l.datapgto,'%d/%m/%Y'),'') AS `dataPgto`, CONCAT('R$ ',REPLACE(REPLACE(REPLACE(FORMAT(IFNULL(l.valorpago, 0), 2), ".", "@"), ",", "."), "@", ",")) AS `valorPago`,
(SELECT COUNT(1) FROM UF_financeiro_lctofinan WHERE  AND fl_excluido='N') AS NUM_PARCELAS
FROM UF_financeiro_lctofinan AS l
LEFT JOIN UF_eventos_participantes AS p ON
LEFT JOIN UF_eventos AS e ON e.id_evento=p.id_evento
LEFT JOIN UF_casas AS c ON p.idcasainscr = c.idcasa
LIMIT 150 -- retirar esse LIMIT depois, isso é apenas para debugar

If that query’s the one causing the problem, what does the database tell you when you try to run it manually?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.