KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Displaying information in a List Box using SQL
PRODUCT: 4D | VERSION: 11 | PLATFORM: Mac & Win
Published On: July 8, 2008

To display all the records and all the fields from a Table in a List Box using 4D V11 SQL we can use:

Begin SQL
select * from Table into:ListBox
End SQL

For example:

To display all the records and all the fields of a Companies table in a List Box called lb_Companies:

Begin SQL
select * from [Companies] into:lb_Companies
End SQL


To display all the records of a Table and only certain fields you could use:

Begin SQL
select FieldName1, FieldName 2 from Table into:ListBox
End SQL

For example:

To display all the records and the Company Name and Address of a Companies table in a List Box called lb_Companies:

Begin SQL
select Company_Name, Company_Address rom [Companies] into:lb_Companies
End SQL


By using the power of 4D v11 SQL commands and the flexibility of a List Box you can display any information from a Table quickly and easily.


Additional information about the SQL commands can be found at:

https://www.4d.com/docs/CMU/CMU00948.HTM

https://www.4d.com/docs/CMU/CMU00949.HTM