KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Code Snippet: Count All Records in Database
PRODUCT: 4D | VERSION: 13.3 | PLATFORM: Mac & Win
Published On: November 20, 2013

The following code snippet can be used for quickly obtaining the total number of records in the database:

C_LONGINT($lastTable;$a;$x)
$x:=0
$lastTable:=Get last table number
For ($a;1;$lastTable)
   If (Is table number valid($a))
      $x:=$x+Records in table(Table($a)->)
   End if
End for
ALERT(String($x))