COUNTAPPROX Function (Record)

Microsoft Dynamics Nav 2009

Returns an approximate count of the number of records in the table, for example, for updating progress bars or displaying informational messages.


Number := Record.COUNTAPPROX

Parameters

Record

Type: Record

Refers to the table to be counted.

Type: Integer

The number of records in the table.

If a filter has been set on the record, this function behaves the same way as the COUNT Function (Record).

The count is approximate because it uses statistical information maintained by SQL Server, which is not kept precisely in synchronization with modifications to the table and is not under transaction control. However, it is much faster to use this information than to perform an accurate record count under transaction control, especially when there are a large number of records in the table.

This example requires that you create the following variables.

Variable name DataType Subtype

FastCount

Integer

 

CustomerRec

Record

Customer

FastCount := CustomerRec.COUNTAPPROX

This statement assigns the approximate number of records in the Customer table to the Number variable.

Community Additions

ADD
Show: