AnsweredAssumed Answered

Filtered PIOLEDB Average

Question asked by esancha on Mar 2, 2018
Latest reply on Mar 5, 2018 by esancha

Hi!

 

I'm trying to get an average filtered through OLEDB, but it does not work as I expect

 

This query runs OK

SELECT value

FROM piarchive..piavg

WHERE tag = 'FFH:A_024'

AND time BETWEEN '01-mar-2018 06:00' AND '02-mar-2018 06:00'

AND calcbasis = 'TimeWeighted'

AND 'FFC:W_004' >= 50

 

But this other don't returns nothing

SELECT value

FROM piarchive..piavg

WHERE tag = 'FFH:A_024'

AND time BETWEEN '01-mar-2018 06:00' AND '02-mar-2018 06:00'

AND calcbasis = 'TimeWeighted'

AND 'FFC:W_004' >= 50

AND ('FFH:A_024' BETWEEN 55 AND 75)

 

I tested with and without parenthesis and if I remove one of the two conditions and I put for example AND 'FFH: A_024' > = 55 also works right

 

There is enough data that meets the condition

timevalue
01/03/2018 6:38:0665,86
01/03/2018 8:10:0665,46
01/03/2018 11:09:1562,69
01/03/2018 22:32:1561,95
01/03/2018 22:59:2266,94
01/03/2018 23:04:1561,54
02/03/2018 0:10:0466,39
02/03/2018 1:32:0465,61
02/03/2018 2:15:3565,11
02/03/2018 3:53:0463,9
02/03/2018 5:13:3063,13
02/03/2018 5:43:3063,41

 

What am I doing wrong?

 

Thanks in advance

Outcomes