Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Error nuRunQuery (Browse)

Questions related to using nuBuilder Forte.
Post Reply
mariri
Posts: 45
Joined: Mon Sep 02, 2019 11:54 am

Error nuRunQuery (Browse)

Unread post by mariri »

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 !
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4307
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 448 times
Contact:

Re: Error nuRunQuery (Browse)

Unread post by kev1n »

I think you will either have to create a view or a temporary table (see here: https://forums.nubuilder.cloud/viewtopic. ... _ID#p19457) since nuBuilder cannot handle complex queries
Post Reply