title: Call scalar function from Select statement
body: <p>I have scalar valued function - fn_GetTaskTime(int). So I want to use returned value in result of select statement. Also I have table called tblTask looks like:</p>
  
  <pre><code>id|TaskName|ParentTask
  ----------------------
   1|Task1   |-1
   2|Task1.2 |1
   3|Task2   |-1
  </code></pre>
  
  <p>I'm trying like this:</p>
  
  <pre><code>select id, taskName, parentTask, dbo.fn_GetTaskTime(id) as Time from dbo.tblTasks 
  </code></pre>
  
  <p>and  get error - "Invalid object name 'tblTask'". 
  Result of function is integer. And I want to have result like:</p>
  
  <pre><code>id|TaskName|ParentTask|Time
  ---------------------------
   1|Task1   |-1        | 20
   2|Task1.2 |1         | 10
   3|Task2   |-1        | 35
  </code></pre>
  
  <p>So what I can do?</p>