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