Skip to content

Instantly share code, notes, and snippets.

@mrezekiel
Last active February 4, 2020 01:31
Show Gist options
  • Save mrezekiel/435cc9de63613488e6f461159376f39a to your computer and use it in GitHub Desktop.
Save mrezekiel/435cc9de63613488e6f461159376f39a to your computer and use it in GitHub Desktop.
For Praveen
-- Citect Historian
DECLARE @iArea INT;
-- SET @iArea = 2797;
SET @iArea = 86;
SELECT DISTINCT left([SampleValue],4) as SampleValue
FROM [dbo].[StringSamples]
WHERE [TagID] = @iArea
AND [QualityID] = 192
AND [SampleValue] IS NOT NULL
AND [SampleValue] <> ''
ORDER BY left([SampleValue],4) DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment