1
我有一个静态的用户名列表作为CR2008中的一个参数。我希望能够使用CR语法将数据库值添加到选定的用户并使用它进行查询。Crystal Reports 2008中的静态参数列表
例如,如果该报告亚军从我的参数列表中选择DOE,约翰,我需要查询使用的东西数据库一样
If {?prmUsers} = "Doe, John" then variableA = "doejoh" And variableB = "[email protected]"
和选择会是这样的:
Declare @BeginDate SmallDateTime
Declare @EndDate SmallDateTime
Set @BeginDate = '2009-01-19'
Set @EndDate = '2009-01-23'
SELECT DISTINCT
DateTime,
[Recipient-Address],
[Message-Subject],
[Sender-Address]
FROM
dbo.Logs
WHERE
LEFT([Recipient-Address], 6) IN ('doejoh') OR
LEFT([Recipient-Address], 10) IN ('[email protected]')
AND DateTime BETWEEN @BeginDate + ' 00:00:00' And @EndDate + ' 23:59:59'
当然,报告运行者可以选择多个名称。 任何想法?