Report with results from column based on parameter

  • I am a newbie to SSRS, I need to create a report that will return an employee's wages for a month supplied by user as a parameter. My source data is a table that has employid, and twelve columns for each month. I need to pass the month selected by the user as a parameter to select the appropriate column. So, simply Select employid, @month from employeesummary, but I can't seem to find the correct way of doing this. Again this one of my first projects in SSRS and any help would be greatly appreciated.

  • You're probably going to have to do that in the query itself. Sadly, probably the easiest way is:

    SELECT

    CASE @month

    WHEN 1 THEN [JanWages]

    WHEN 2 THEN [FebWages]

    ...

    END AS Wages

    FROM

    WHERE EmployeeID = @empid

    --J

  • Thank you, I was working in that direction, but your post resolved an issue I was having. Thanks again!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply