Building a report in SSRS 2008. I need to capture the built-in User!UserId variable so I can use it in my dataset query. It is part of my report security. I have tried a couple ways, but niether worked:
DECLARE @currentUser varchar(30) =User!UserID
and inline:
SELECT @retVal = COUNT(*)
FROM MySecurityTable
WHERE ExpirationTime > GETDATE() AND UserName =User!UserId