I'm using LibreOffice Base 5.3.4.2 as a front-end for a postgres database. In postgres, I have the following tables:
lu_ss_unit_types
(lookup table that stores different unit types)
ss_unit_mix
(uses fkey
from lu_ss_unit_types
)
ss_rent_surveys
(uses fkey
from ss_unit_mix
)
In LO, I have a subform for ss_rent_surveys
under a form for ss_unit_mix
. Within the ss_rent_surveys
subform table control there is a listbox column for ss_unit_mix_id
which I've labeled "Unit Type" and concatenates information from the ss_unit_mix
and ss_unit_types
tables.
Here's the problem: the following code in the List Content for the listbox control I get the error "missing-FROM clause entry for table 'm'." However, when I run the SQL straight from PGAdmin, it works fine. What gives?
SELECT t.unit_type||' ('||
CASE WHEN m.interior IS TRUE THEN 'Int' Else 'Ext' END||'/'||
CASE WHEN m.upper_level IS TRUE THEN 'Upper' Else '1st' END||'/'||
CASE WHEN m.climate_controlled IS TRUE THEN 'CC' Else 'Standard' END||')',
m.ss_unit_mix_id
FROM properties.ss_unit_mix m
LEFT JOIN lookup.lu_ss_unit_types t ON t.ss_unit_type_id = m.ss_unit_type_id;