title: Could I pass a parameter to a CTE from SSRS?
body: <p>I have the following VIEW on my data server</p>
  <pre><code>CREATE VIEW [test_view] AS
      EpicActual (EpicID, Actual) AS
      (
          SELECT
              I.EpicID,
              CAST(WL.timeworked / 3600 AS DECIMAL(10,2))
          FROM TasksTable ST
          INNER JOIN IssuesTable I ON I.ID = ST.IssueID
          INNER JOIN worklog WL ON WL.issueid = ST.ID
      ),
  
      SELECT 
          ISNULL(A.Actual, 0) + CAST(ISNULL(E.TIMESPENT, 0) / 3600 AS DECIMAL(10,2)) [TotalActual],
          E.PROJECT,
          E.REPORTER,
          E.ASSIGNEE
  
      FROM jiraissue E 
      LEFT OUTER JOIN EpicActual A ON A.EpicID = E.ID
      WHERE E.issuetype = 6
  GO
  </code></pre>
  <p>The &quot;EpicActual&quot; CTE uses the worklog table, which is the amount of work for the issue. The worklog table contains a CreatedDate.</p>
  <p>an SSRS report uses this view to create a report. It also contains a parameter named &quot;CreatedAfter&quot;, which is supposed to be used to obtain worklog entries created after this date. I was wondering if it's possible to add this to the CTE? (e.g. add something like &quot;WHERE WL.CreatedDate &gt;= @CreatedAfter&quot; in the query of the CTE).</p>