Please enable JavaScript to view this site.

R:BASE 11 Beginners Tutorial

Navigation: Lesson 3 - Viewing Data

Specifying a Condition for a Query

Scroll Prev Top Next More

Let's say that we would like to see a list of the flights scheduled for June 3, 2022. Since we don't want to see all of the data in the table, we need to limit the data that R:BASE retrieves. We'll, specify a condition to limit the data to a flight date of June 3, 2022.

 

To specify a condition for the query:

 

1.In the "Query Builder" window, right-click on "Flights T1" from the list of "Tables/Views In Use".
2.From the pop-up menu, choose WHERE Clause.

 

The Where Builder dialog box opens. The "WHERE Builder" lets you work with conditions. "Flights" is selected in "Table Name" and the columns from the Flights table are listed in "Select Column."

 

3.Select "FlightDate" from "Select Columns" panel.
4.Click the "Add Column" button.

 

"T1.FlightDate" is displayed in "WHERE Clause" panel.

 

Now we need to choose an operator. The table below describes each of the operators.

 

Operator

Description

=

Equal to

<>

Not equal to

>

Greater than

>=

Greater than or equal to

<

Less than

<=

Less than or equal to

BETWEEN

Greater than or equal to value] and less than or equal to value2

+

Addition, concatenation

-

Subtraction

*

Multiplication

/

Division

(

Left parentheses

)

Right parentheses

IN

Value of column exists in selected rows

NOT

Negation

IS NULL

Column contains no value (null)

IS NOT NULL

Column contains any value

LIKE

Column equals string

AND

The condition following AND must be met in addition to the condition before it

CONTAINS

Column contains a string called string

OR

Either the condition before OR or the condition following it must be met

 

 

We want to display only those rows that have the exact value of "06/03/2022" in the FlightDate column.

 

5.In "Operators and Keywords", click the "=" button.

 

The operator "=" (equals) is added to the "WHERE Clause" text.

 

6.Enter "06/03/2022" in "WHERE Clause" text.
7.To test the syntax of your WHERE clause, click the "Test Clause..." button.

 

A dialog box displays the message, "Your query tested OK!"

 

WHEREBuilder_flightdate

 

 

8.Click the OK button.

 

If an error message is displayed instead, click the OK button and correct the WHERE clause.

 

9.Click the OK button to close the "WHERE Builder" dialog box.

 

The WHERE clause you built in the WHERE Builder has now been added to the SELECT syntax panel.

 

To see the results of the query:

In the "Query Builder" window, choose Query: Browse Query from the main menu bar or select the "Browse Query" button on the toolbar.

 

R:BASE searches the Flights table for all the rows that meet the condition and then displays the data in the "Data Browser" window.

 

There are five flights. The EmployeeID column is not displayed; only the selected columns are displayed in the order they were selected.

 

10.Close the Data Browser by selecting the "X" button or pressing the [Esc] key.