Query Builder

Description

The Query Builder allows you to quickly create filter and order expressions and apply them to a table or set. To use the Query Builder :

  1. Display the Operations tab of the Control Panel.

  2. Click New to display the Create New Operation dialog.

  3. Choose "Query records" from the Select Operation list.

  4. Pick the table or set from the Select Table/Set list.

  5. Click Create.

  6. On the Filter/Order Expression tab:

    • Optionally, enter an expression into the Filter Expression field. Click the 'xy' icon to use the Expression Builder to help you define the expression.

    • Optionally, enter an expression into the Order Expression field. Click the 'xy' icon to use the Expression Builder to help you define the expression.

  7. Display the Query Options tab.

  8. Optionally, check the Exclude records that satisfy search criteria to invert the logic of the query.

  9. Optionally, check Unique records only to eliminate duplicate records.

  10. Optionally, limit the records you retrieve by using a function in the Sub-select Options list.

  11. If required, enter the value of N.

  12. Click Run Query to filter and sort the records visible in your layout.

  13. Click Close to exit from the Query Builder.

  14. Click the 'circular arrow' icon to roll up the Query Builder.

    images/Rollup_button.gif
  15. Click the 'binoculars' icon to display the Filter/Order Expressions dialog box, which show Xbasic filter and order expressions you created in the Query Builder. This is an excellent way to learn or copy the syntax for creating filter and order expressions.

    images/Preview_Button.gif
  16. Click to switch from Genie Mode to Expression Mode. If you save the filter as an expression, you can no longer edit it using the Query Builder. Advanced users can use Expression Mode to type in additional filter and order expressions.

  17. Click the 'floppy disk' icon to save the query for later re-use.

  18. Click the following to save the query with a new name.

    images/Save_As_button.gif
  19. Click the 'open folder' icon to load a previously saved query.

  20. Click the following to load create a new query.

    images/New_Query_button.gif

See Also