【发布时间】:2012-08-22 02:06:30
【问题描述】:
我之前得到了一些非常好的帮助,我很感激。 我又遇到了一个唱片选择问题。
我有一个参数需要设置为结束日期。
我需要从名为 state_change 的表中提取结束日期之前的最新状态。
我需要从报告中排除在该时间段内未处于所需状态的任何记录。
state 当前设置为 state_change.new_state
( {@grouping} = "Orders" and rec_date < {?endDate} and {@state} in [0,2,5] )
OR
( {@grouping} = "Stock" and rec_date < {?endDate} and {@state} in [1,2,3,5,7] )
如果我可以运行 SQL 查询来提取此信息,它可能会起作用,但我不知道该怎么做。
基本上,我需要@state 是:
Select max(new_state)
From state_change
where change_time < {?endDate}
但在每个项目级别。
任何帮助将不胜感激。
【问题讨论】:
标签: sql parameters crystal-reports record