根据数据,如果你在过滤器可能会取得更好的结果数据的来源,但不知道你在报告什么是不可能知道的。
如果您正在过滤报告中显示的内容,您可能只是通过网络拖动大量数据,以便在报告中禁用它。为什么不只是在源代码中进行过滤?
在SQL Server中,你可以通过时间ID做前N个功能是这样的(测试数据包括在内)
create table t3 (id int, supplierId int, description varchar(max), value decimal(5,2), created datetime default getdate())
insert into t3 values
(1, 1, 'test', 180.0, '20101001'),
(1, 1, 'test', 181.0, '20101003'),
(1, 1, 'test', 182.0, '20101002'),
(1, 2, 'test', 183.0, '20101005'),
(1, 2, 'test', 184.0, '20101002'),
(1, 2, 'test', 185.0, '20101001')
;with cte as
(select
t.id
, t.supplierId
, t.description
, t.value
, t.created
, rank() over (partition by t.supplierId order by t.created desc) as Position
from t3 t)
select * from cte where Position = 1
你不能在你的数据源中做到这一点吗?什么是您的数据源? – 2010-12-21 21:55:59