NE

NE, NOT, #, <>, ><

Top  Previous  Next

 

The NE selection clause operator compares a field or evaluated expression against another field, evaluated expression or literal value and tests for the first item being not equal to the second. The synonyms NOT, #, <> and >< can be used.

 

 

Format

 

field NE {NO.CASE} value

 

where

 

fieldis the first field or evaluated expression to be compared.

 

valueis the second field, evaluated expression or literal value to be compared. The optional NO.CASE qualifier causes a case insensitive comparison to be applied.

 

 

The NE selection clause operator returns True if field is not equal to value.

 

The default behaviour of the query processor is that if field is defined as left justified in the dictionary, an exact match string comparison is used. For right aligned fields (typically numeric values) a numeric comparison will be used if the field content and value are both integer values. The QUERY.STRING.COMP or QUERY.STR.COMP.ALL modes of the OPTION command can be used to apply string character comparisons to all data.

 

 

Example

 

LIST STOCK WITH QTY NE 0

 

This command lists items found on the STOCK file with a non-zero QTY. If QTY is defined as left justified, the content of this field must be the single digit 0 for the record to be included in the report. If QTY is defined as right justified, records for which QTY holds any numeric data equal to zero will be included (e.g. 00).

 

 

Pick Style Wildcards

 

If the PICK.WILDCARD option is enabled (see the OPTION command) and the value item is a literal value, the interpretation is extended to include use of Pick style wildcard characters:

A [ character at the start of the value replaces any number of leading characters. It is equivalent to the … action of the UNLIKE operator.

A ] character at the end of the value replaces any number of trailing characters. It is equivalent to the … action of the UNLIKE operator.

A ^ character within the value replaces a single character. It is equivalent to the 1X action of the UNLIKE operator.