KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Querying Boolean Fields in SQL SELECT Statements
PRODUCT: 4D | VERSION: 13.0 | PLATFORM: Mac & Win
Published On: June 29, 2012

This Technical Tip demonstrates how to query boolean fields in an SQL SELECT statement. For example, if there is a table as shown below, one might want to query for all current students.



This query can be done in an SQL SELECT statement as follows:

ARRAY TEXT(firstName_arr;0)
ARRAY TEXT(lastName_arr;0)
ARRAY TEXT(studentID_arr;0)

Begin SQL
   SELECT firstName, lastName, studentID
   FROM Students
   WHERE isCurrentStudent = TRUE
   INTO :firstName_arr, :lastName_arr, :studentID_arr;

End SQL