AnsweredAssumed Answered

Multiple OLEDB queries using UNION returns different result sets

Question asked by viveks on May 24, 2016
Latest reply on May 24, 2016 by lmlcoch

Hi All,

 

Wanted to find the eventcount for a tag over specified time and found this is the closest way to get it using OLEDB.

SELECT COUNT(*) FROM piarchive..picomp2 WHERE tag = mytag AND time > *-30m and time < *

UNION

SELECT COUNT(*) FROM piarchive..picomp2 WHERE tag = mytag AND time > *-60m and time < *-30m

UNION

4 More queries until *-24h

 

However sometimes it returns only 5 results and some times 6.  Can you help me figuring out why that is so?  I use the OLEDB Tester tool .

 

Thanks

Outcomes