Error nuRunQuery (Browse)
Posted: Fri Dec 13, 2019 10:54 am
Hi guys !
In a browse, the SQL code is :
SELECT
p.foyer_key,
p.personne_nom,
p.personne_prenom,
t.finSejour
FROM personne p
INNER JOIN titre_sejour s ON s.titre_sejour_personne_id = p.personne_id
INNER JOIN (SELECT titre_sejour.titre_sejour_personne_id, MAX(titre_sejour.titre_sejour_date_fin) as finSejour FROM titre_sejour GROUP BY titre_sejour.titre_sejour_personne_id) t ON t.finSejour = s.titre_sejour_date_fin
WHERE
t.finSejour>= NOW()
AND
TIMESTAMPDIFF(WEEK, NOW(), t.finSejour)<=2
ORDER BY
t.finSejour ASC
But when I open the browse form, there is no result. In the debug results, I have this following error message
Why the part "GROUP BY titre_sejour.titre_sejour_personne_id) t ON t.finSejour = s.titre_sejour_date_fin WHERE t.finSejour>= NOW() AND TIMESTAMPDIFF(WEEK, NOW(), t.finSejour)<=2" is duplicated ? How do we fix it ?
Thanks !
In a browse, the SQL code is :
SELECT
p.foyer_key,
p.personne_nom,
p.personne_prenom,
t.finSejour
FROM personne p
INNER JOIN titre_sejour s ON s.titre_sejour_personne_id = p.personne_id
INNER JOIN (SELECT titre_sejour.titre_sejour_personne_id, MAX(titre_sejour.titre_sejour_date_fin) as finSejour FROM titre_sejour GROUP BY titre_sejour.titre_sejour_personne_id) t ON t.finSejour = s.titre_sejour_date_fin
WHERE
t.finSejour>= NOW()
AND
TIMESTAMPDIFF(WEEK, NOW(), t.finSejour)<=2
ORDER BY
t.finSejour ASC
But when I open the browse form, there is no result. In the debug results, I have this following error message
Why the part "GROUP BY titre_sejour.titre_sejour_personne_id) t ON t.finSejour = s.titre_sejour_date_fin WHERE t.finSejour>= NOW() AND TIMESTAMPDIFF(WEEK, NOW(), t.finSejour)<=2" is duplicated ? How do we fix it ?
Thanks !