Query by Formula Overview
The SapphireOne Query by Formula tool allows the Sapphire user to execute a query on a transaction inquiry subset using a specified custom formula. Query by formula is similar to a Detailed Query (Control Y on Windows Command Y on MacOS ).
The screen below is a simple example asking SapphireOne to display all transactions with a sequence number greater than 24200.


- Save and Load – Any queries set up may be saved on your local drive using the
button. We recommend you create a folder for these queries within your SapphireOne Application folder. These same queries at a later time may be utilised using the
button. Once either of these buttons are selected the standard options for saving or opening a file are displayed. - Transaction Selection – SapphireOne has the ability to query transactions in any table.
- Query In Selection – Selecting this checkbox forces SapphireOne to perform the current query using the displayed transactions only.
Query by Formula is designed for writing search conditions that involve operations such as:
- Performing operations on alphanumeric strings and making evaluations of them.
- Searching the results of date computations.
- Searching the results of arithmetic computations.
Rules and Restrictions
- if you want to start a new query de-select (remove the tick) from the Query in Selection checkbox. SapphireOne will not perform your query in the currently displayed transactions if this option is selected.
- The formula must be a Boolean expression, i.e. returning a true or false value.
- Formulas can only be one logical line long without carriage returns. Do not press the Return key at the end of each line. The editing area will automatically wrap if the statement extends beyond the viewport.



