Support Forums
VTScada REST SQL Query Result Combination into one single row

We currently testing the VTScada REST SQL Query function against historian data.

We are querying two tags:

MORESCO-1\CalcTags\Lumbo\LumF1\SustainedUnsched\Cust-Min:Value
MORESCO-1\CalcTags\Lumbo\LumF1\SustainedUnsched\Cust-Aff:Value

using the following SQL query:

SELECT timestamp,
'MORESCO-1\CalcTags\Lumbo\LumF1\SustainedUnsched\Cust-Min:Value' AS CustMin,
'MORESCO-1\CalcTags\Lumbo\LumF1\SustainedUnsched\Cust-Aff:Value' AS CustAff
FROM History
WHERE timestamp BETWEEN '2026-05-28' AND '2026-06-27'
ORDER BY timestamp ASCENDING

The query result returns separate historian records for each tag. Since the two tag updates occur approximately 1 ms apart and timestamp different, VTScada stores them as individual historian events, resulting in output similar to attached query result.

6a37480d47d5b
6a37480d8d35d

We would like to know whether can we combine or there is a method to combine these into a single record like below? Could you please guide me how to do?

6a37481c30553

We currently testing the VTScada REST SQL Query function against historian data. We are querying two tags: MORESCO-1\CalcTags\Lumbo\LumF1\SustainedUnsched\Cust-Min:Value MORESCO-1\CalcTags\Lumbo\LumF1\SustainedUnsched\Cust-Aff:Value using the following SQL query: SELECT timestamp, 'MORESCO-1\CalcTags\Lumbo\LumF1\SustainedUnsched\Cust-Min:Value' AS CustMin, 'MORESCO-1\CalcTags\Lumbo\LumF1\SustainedUnsched\Cust-Aff:Value' AS CustAff FROM History WHERE timestamp BETWEEN '2026-05-28' AND '2026-06-27' ORDER BY timestamp ASCENDING The query result returns separate historian records for each tag. Since the two tag updates occur approximately 1 ms apart and timestamp different, VTScada stores them as individual historian events, resulting in output similar to attached query result. ![6a37480d47d5b](serve/attachment&path=6a37480d47d5b) ![6a37480d8d35d](serve/attachment&path=6a37480d8d35d) We would like to know whether can we combine or there is a method to combine these into a single record like below? Could you please guide me how to do? ![6a37481c30553](serve/attachment&path=6a37481c30553)
edited 2 days ago at 3:13 am
10
0
1
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft