Description: Returns the target entry value from the latest source-object record at or just before a timestamp, optionally restricted by entry/value pairs.
Calling convention: CIP_GetValueByDateTime("SourceObjectName": String, "SourceEntryName": String, "DateTimeEntryName": String, DateTimeEntryValue: DateTime, ["CustomEntryName": String, CustomEntryValue: Variant, ...]): Variant
Parameters:
SourceObjectName: database-backed source object.
SourceEntryName: value entry to return.
DateTimeEntryName, DateTimeEntryValue: timestamp entry and upper-bound value.
CustomEntryName, CustomEntryValue: optional filter pairs; DateTime filters use the configured timestamp tolerance.
Returns: Value from the newest matching row, or Variant NULL when no row matches. Invalid objects, entries, NULL timestamp or an incomplete filter pair raise exceptions.
Availability: Default; performs a parameterized database query using the source object's connection.
Example:
LastAmount := CIP_GetValueByDateTime("Production", "Amount", "StartTime", Now(), "LineID", 4);