JoelBrabant

IN Statement with piinterp table

Discussion created by JoelBrabant on Dec 15, 2009
Latest reply on Dec 28, 2009 by andreas

Hi,

 

I use a linked server and I wonder why this statement works

select value 
from pisrv.piarchive..piinterp2
where tag='tag'
   and time in ('2009-11-05 16:15:00','2009-11-17 00:00:00','2009-11-17 01:00:00','2009-11-17 02:00:00','2009-11-17 03:00:00')

and not this one?

select value 
from pisrv.piarchive..piinterp2
where tag='tag'
   and time in (select ts from table1)

ts column is of type datetime

 

The error I get is:

 

 

 

[OLE/DB provider returned message: Query into 'piarchive..piinterp2 Tbl1001' table is invalid. 'time' column must be restricted either to a set of intervals or to a set of values.]

 

OLE DB error trace [OLE/DB Provider 'PIOLEDB' ICommandText::Execute returned 0x80004005: ].

 

This statement works well

Select value 
from pisrv.piarchive..picomp2
where tag<='tag'
   and time in (select ts from table1)

Outcomes