CountRec

Use this function to count the number of records in an extract file transaction that match a search mask parameter. In addition, you can also make sure that at least a minimum number of records match the search mask parameter.

Syntax

CountRec (SearchMask, MinNumber)

Parameter

 

SearchMask

The search mask you want to use for the search.

MinNumber

(Optional) Number of records that must exist in the transaction.

Set this parameter to 1 if you want to know if a record exists that matches the search mask.

This function returns the total number of records found, the MinNumber of records if they exist, or zero (0) if no records match the search mask or there are less than the MinNumber of records.

Example

Lets assume there are five records in a transaction with the following values in the applicable columns.

0 3

1 1

 

Address1 AA

Address2 BB

Address3 BB

Address4 BB

Address5 CC

Function

Result

Explanation

CountRec ("1,Address")

5

The function returns five (5) because there are five records that match the search mask in the transaction.

CountRec ("1,Address,31,BB", 2)

2

The function returns two (2) because there are at least two records that match the search mask in the transaction.

CountRec ("1,Address", 6)

0

The function returns zero (0) because there are less than six records in the transaction that match the search mask.

CountRec ("1,Address,31,AA", 2)

0

The function returns a zero (0) because there are less than two records that match the search mask.

See also