
--Example 1
	--The HiLevelEvent is detected and historized without further action
	
	SELECT	TagName, DateTime, DetectDateTime
	FROM	EventHistory
	WHERE	TagName='HiLevelEvent'

	--1. How many times has the HiLevelEvent happened during the last hour?____
	--2. Analyze the DetectDateTime  vs DateTime columns. Any difference?

--Example 2
	--The Scheduled event occurs every 15 minutes and it summarizes data from other tags.

	SELECT	TagName, DateTime, DetectDateTime
	FROM	EventHistory
	WHERE	TagName= 'ScheduledEvent'

	--3. How many times has the ScheduledEvent happened during the last hour?__
	--4. Do the DateTime and DetectDateTime colume values match?

--Example 3
	--In the SummaryData table the AVG, MAX and MIN for the Scheduled event are
	--historized.

	SELECT	*
	FROM	v_SummaryData 
	WHERE	EventTag='ScheduledEvent'

--Example 4
	--The TransferEvent happens every time the outlet valve opens:
	
	SELECT	TagName, DateTime, DetectDateTime
	FROM	EventHistory
	WHERE	TagName= 'TransferEvent'

--Example 5
	--To retrieve the snapshot data use the v_EventSnapshot view. 
	
	SELECT	* 
	FROM	v_EventSnapshot
	WHERE	Event='TransferEvent'

