Hello All,



I have data as follows

Tag
Names
VALUE TIMESTAMP
Tag1 123.23
"2017-09-06 20:00:00"
Tag2 12.12
"2017-09-06 20:00:00"
Tag3 45.25
"2017-09-06 20:00:00"
Tag4 69.89
"2017-09-06 20:00:00"
Tag1 25.25
"2017-09-06 20:15:00"
Tag2 25.25
"2017-09-06 20:15:00"
Tag3 87.65
"2017-09-06 20:15:00"
Tag4 25.36
"2017-09-06 20:15:00"
Tag1 89.36
"2017-09-06 20:30:00"
Tag2 47.36
"2017-09-06 20:30:00"
Tag3 235.36
"2017-09-06 20:30:00"
Tag4 89.36
"2017-09-06 20:30:00"



Now I want to provide the feature as that

User can see all the tagnames available.
This tagnems will be fetched from Table1.

He will select multuiple tags and then will select time range friom filter .Example

Data for Tag1 and Tag4 time range
"2017-09-06 20:00:00"
to
"2017-09-06 21:30:00"


After this query will be passed to my database with tag names and time range.
It should give the result shown as above from Table2.



So all the available data will be displayed to user.

Note
1. I want this to be done on run time.
2. I am getting full tag list from table1 and selected tags list & respective data,timestamp from table 2.

Sequence would be

1. Fetching all tag name from Tabl1
2. Selecting desired tag names (may be using filter)
3. Passing time range (May be using filter)
4. It will query to database
5.Getting result as shown in above table.(from table2)



The result should look like below

TAG1 TAG2 TAG3
"2017-09-06 21:30:00" 12 45.24 12.36
"2017-09-06 21:30:00" 12.22 85.58 87.36
"2017-09-06 21:30:00" 45.22 25.366 52.25


Kindly Help

Thanks