Hi,
I need to assign output from SELECT statement to a declared variable. The statement mentioned below works with no issues.
SET @TrackCount = (select count(events) from import_temp where @Id= Id)
Now I need to assign the data retrieved from the below mentioned SELECT statements.
SELECT MAX(ScanDateTime) FROM import_temp WHERE @Id = Id
SELECT MAX(DataDateTime) FROM import_temp WHERE @Id = Id
SELECT max(convert(nvarchar,DataDateTime - ScanDateTime,108))
FROM import_temp
WHERE @Id = Id
SELECT convert(nvarchar, convert(datetime, avg(convert(real, DataDateTime))), 108 )
FROM import_temp
WHERE @Id = Id
Is it possible to store the values returned from the above SELECT statements using SET command ( as shown for 1st SELECT stat above) ??
Thanks,
Sanchit