我可能问错了这个问题,但这是我想要做的:
我的 SP 中有以下选择语句。我将在 SSRS 中使用此语句让用户通过参数传递值。但是,我的问题是我能想到的唯一参数是Status
参数。我使用 case 语句创建了一个计算列。
我希望 SSRS 中的用户选择一个值:已 发布、未发布或全部。
我将如何使用计算的列和状态来做到这一点?
注意: SIS.cs_id_number 和 PC.css_id 是一个整数值。
BEGIN
SELECT PC.css_id as [CSS ID]
, convert(VARCHAR, PC.birth_date, 101) AS DOB
, PC.first_name as [First Name]
, PC.last_name as [Last Name]
, ssn as [SSN]
, substring(PC.css_record, CHARINDEX('<AddressLine>', PC.css_record) + 22,CHARINDEX('</AddressLine>', PC.css_record)- CHARINDEX('<AddressLine>', PC.css_record) - 25) as [Street]
, City
, substring(PC.css_record, CHARINDEX('<StateProvinceCode>', PC.css_record) + 19 , 2 ) + ' - ' + substring(PC.css_record, CHARINDEX('<PostalCode>', PC.css_record) + 12 , 5 ) AS [State & ZipCode]
, **[Status] = CASE WHEN SIS.cs_id_number = PC.css_id THEN 'POSTED' ELSE 'Not Posted: Student may not be in PF Database yet or there might be a mismatch' end**
FROM
profile_convert PC
left JOIN say_im_stu SIS
ON SIS.cs_id_number = PC.css_id
order by css_id
End