# sselect command

The sselect command creates a sorted
list of items from the specified file reference that meet selection
criteria.

## Syntax

```
sselect file.reference {item.list} {selection.criteria} {sort.criteria}
{output.specification} {modifiers}{(option)}
```

## Parameter(s)

| options | b | Suppresses the n items selected message at the end of the sselect (same as j; see ni-supp modifier). |
| --- | --- | --- |
| j | Suppresses all messages (n items selected, and so on). | |
| s | Activates a secondary list. | |
| q | Bypasses index selection. | |
| t{number} | Displays a periodic running total of the progress of the sselect (also select and count): the approximate number of items selected followed by the approximate number scanned. The period defaults to every 100 items selected and can be changed by appending a number after the t. | |
These are the options most often used with sselect. As a retrieval sentence it accepts the full set of AQL options, though the report-formatting options have little effect since sselect builds a list rather than a report.

[Full referenceAll AQL options →The complete table of options every select, sselect, sort, and list sentence accepts, with descriptions and modifier equivalents.](https://d3codex.com/access/options-access-query-language/)

## Description

The list is a temporary list
that is used by the next command as its implicit item list. The list
can be permanently saved by the save-list command.
The list can also be passed to an Output processor command or to a
FlashBASIC program if the next TCL command executes that program.
When an *output.specification* displays in any of
the various select sentences, the list is built from the contents
of the specified attribute.

The elements of the list may be
used as item-IDs to reference data in any file, not just the file
referenced in the sselect command. For example,
if a sselect on one file is followed by a list on a different file, the list of item-IDs generated
by the sselect are used as an item list in the list.

In the special case where the sselect command is used with a by-exp or by-dsnd-exp modifier, the elements of the list are MultiValue, where the first
value is the selected data, and the second value is the 3-digit value
count. In

FlashBASIC, the two values are retrieved by the use
of the readnext ID,vc form of the readnext statement.

## Example(s)

Creates a list of invoice item-IDs
that have an `amount.due > 0`, and which have not made
a payment. The list is sorted by invoice item-ID.

```
sselect invoices with amount.due > 0 and with no payment
```
Creates a list of entity names that start with the string `ROCKET` sorted in name order.

```
sselect entity by name with name = "ROCKET]" name
```
The session below, run on D3 10.3.4, selects every master-dictionary entry whose item-ID begins with `S` and returns them as a sorted list. The first sentence reports its count; the second, with the b option, builds the same sorted list silently. The `>` prompt indicates an active select list is pending.

```
:SSELECT MD = 'S]'
[404] 274 items selected out of 1723 items.
>SSELECT MD = 'S]' (B
>
```

## See also

- [.chain command (Output processor)](https://d3codex.com/output-processor/dot-chain-command-output-processor/)
- [.readnext command (Runoff)](https://d3codex.com/runoff/dot-readnext-command-runoff/)
- [Active list](https://d3codex.com/definitions/active-list/)
- [AQL command categories](https://d3codex.com/access/aql-command-categories/)
- [compare-list command](https://d3codex.com/tcl/compare-list-command/)
- [copy command](https://d3codex.com/tcl/copy-command/)
- [end command (TCL commands)](https://d3codex.com/tcl/end-command-tcl-commands/)
- [get-list command](https://d3codex.com/tcl/get-list-command/)
- [nselect command](https://d3codex.com/access/nselect-command/)
- [Options (Access Query Language)](https://d3codex.com/access/options-access-query-language/)
- [qselect command](https://d3codex.com/tcl/qselect-command/)
- [readnext statement](https://d3codex.com/pickbasic-flashbasic/readnext-statement/)
- [Secondary list](https://d3codex.com/definitions/secondary-list/)
- [nselect command](https://d3codex.com/access/nselect-command/)
- [Selection criteria](https://d3codex.com/access/selection-criteria/)
- [Selection processor](https://d3codex.com/definitions/selection-processor/)
- [sort-list command](https://d3codex.com/tcl/sort-list-command/)
- [wselect command](https://d3codex.com/tcl/wselect-command/)

---
Source: https://d3codex.com/access/sselect-command/ - part of the D3Codex reference.
