Page 2 of 2
Re: Displaying Lookup results in Browse Grid
Posted: Thu Sep 23, 2021 5:19 pm
by devjr
Actually I did try that before and it also didn't work - because of another issue which I'm finding now - specifically that I can't seem to get column aliases to work.
So, this will work:
nuBuilder_1_3.jpg
and shows this:
nuBuilder_1_4.jpg
But this won't work:
nuBuilder_1_5.jpg
Can you spot what I'm doing wrong?
Thanks,
Jusitn
Re: Displaying Lookup results in Browse Grid
Posted: Thu Sep 23, 2021 5:24 pm
by kev1n
When you press CTRL+SHIFT+I you can inspect the generated SQL statements.
Re: Displaying Lookup results in Browse Grid
Posted: Thu Sep 23, 2021 5:37 pm
by devjr
Thanks, using this method it shows me that the generated SQL is:
Code: Select all
SELECT lst_id,lst_subject,test,lst_notes
FROM lesson_set ls LEFT JOIN term t ON t.ter_id = ls.lst_term
WHERE 1
Therefore I can see that the generated SQL is not using column aliases as I would expect - it is just trying to get a new column called "test" from result set.
It /should/ be:
Code: Select all
SELECT lst_id,lst_subject,CONCAT(t.ter_year) AS 'test', lst_notes
FROM lesson_set ls LEFT JOIN term t ON t.ter_id = ls.lst_term
WHERE 1
Am I missing something?
Thanks again.
Re: Displaying Lookup results in Browse Grid
Posted: Fri Sep 24, 2021 7:44 am
by kev1n
It looks like the SQL parser cannot handle that. (You would need a SELECT * FROM (SELECT ...) construct again)
What's the purpose of this CONCAT anyway?