Skip to main content

mes.fnGetCount

Description

Returns the sum of counter values for a given counter Id within a time range.

Syntax

mes.fnGetCount(@rangeStart, @rangeEnd, @counterId)

Parameters:
  • @rangeStart (datetime): Start of the time range
  • @rangeEnd (datetime): End of the time range (nullable; defaults to current time)
  • @counterId (int): Id of the counter

  • Returns:
  • float: Sum of counter values
  • Example Code:

    SELECT mes.fnGetCount(
    '2025-07-01T00:00:00',
    '2025-07-30T00:00:00',
    1012
    ) AS total_count;