Welcome to the nuBuilder Forums!

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

Using SQL Lookup Values in Browse Form Columns

Locked
jkdev
Posts: 20
Joined: Fri Aug 01, 2014 2:26 pm

Using SQL Lookup Values in Browse Form Columns

Unread post by jkdev »

I would like to display looked up values from another table in Browse Form Column.

I followed the Tutorial but could not figure out how to have a SQL like follows as the DISPLAY criteria:
SELECT prt_type FROM producttype WHERE prt_typeid = pro_type

If I enter a SQL statemement like this, from the error message it appears that teh code tries to embed my SQL statment inside another SELECT statement which convers the whole form and then fails.

In your tutorial, it is shown as just IF THEN statment and embed the values in the statement. I want the values to be looked up from another table.

jk
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Using SQL Lookup Values in Browse Form Columns

Unread post by massiws »

jkdev,
you have to get values from the producttype table using JOIN in SQL field:

Code: Select all

SELECT * FROM product INNER JOIN producttype ON prt_typeid = pro_type 
So in Browse Display field you can simply insert the producttype field name:

Code: Select all

prt_type
Hope this helps,
Max
jkdev
Posts: 20
Joined: Fri Aug 01, 2014 2:26 pm

Re: Using SQL Lookup Values in Browse Form Columns

Unread post by jkdev »

Thanks! Got the concept now.
massiws
Posts: 503
Joined: Thu May 24, 2012 2:08 am
Location: Milan, Italy
Contact:

Re: Using SQL Lookup Values in Browse Form Columns

Unread post by massiws »

.
Locked