Welcome to the nuBuilder Forums!

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

Subform Columns From JOIN

Questions related to using nuBuilder Forte.
Post Reply
vario
Posts: 153
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 1 time
Been thanked: 1 time

Subform Columns From JOIN

Unread post by vario »

I am converting my v3 to v4.5 and stuck at converting a subform which pulls in extra info from another table.
The subform is based on table paying_in, and the browse SQL is:

Code: Select all

select pay_cash_tendered, DriverID, Driver, Duty, CashAmt, AnnulAmt
from paying_in
join cash_date on (cash_date_id = pay_cash_date_id)
join ticket_summary on (cdt_date = SchedDate and pay_emp_driverno = DriverID and pay_duty_id = Duty)
order by Driver asc
Problem is none of the fields from ticket_summary (capitalized names - from another system) are displayed. Any ideas?
nac
Posts: 115
Joined: Tue Dec 12, 2017 11:28 pm
Location: Aberdeen, UK
Has thanked: 9 times
Been thanked: 12 times

Re: Subform Columns From JOIN

Unread post by nac »

Hello vario,

Here is one idea you could try. Take the SQL statement and create a view. (It may be a bit more readable if you use table aliases and then prefix the columns with alias). The view will also need to be updatable, of course.

Once the view is created, try using that as the 'Table Name' for the subform instead of the table ' paying_in'.

Neil
Last edited by nac on Thu Apr 29, 2021 5:32 pm, edited 2 times in total.
kev1n
nuBuilder Team
Posts: 4304
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Subform Columns From JOIN

Unread post by kev1n »

Hi vario,

Neil's suggestion will definitely work.

Important Note: Log in again into nuBuilder after creating the view.
vario
Posts: 153
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 1 time
Been thanked: 1 time

Re: Subform Columns From JOIN

Unread post by vario »

Yes, works nicely thanks.
nac
Posts: 115
Joined: Tue Dec 12, 2017 11:28 pm
Location: Aberdeen, UK
Has thanked: 9 times
Been thanked: 12 times

Re: Subform Columns From JOIN

Unread post by nac »

vario wrote:Yes, works nicely thanks.
Great - you can find out which views can be updated using :

Code: Select all

SELECT table_name, is_updatable FROM information_schema.views WHERE table_schema = 'your_database_name'
The primary key will determine which of the tables that comprise the view will be updated. Only objects from this table should be 'editable' on the form. The others should be 'read-only'.

Neil
Post Reply