title: Select statements included within a function cannot return data to a client_New
body: <p>I've been reading about the error on the question title but I cannot figure out what is the error on my code below:</p>
  
  <pre><code>CREATE function [RPT].[MonthlyRollupDates_Delimited]()
  RETURNS @table TABLE (Value varchar(max))
  AS
  BEGIN
  
  Declare @Count int , @Date date = getdate(),@Month int
  SET @Month = MONTH(@Date)
  SET  @Count = @Month +12
  
  
  Select 
  top (@Count) 
  CalendarDate,   BusinessDay, Label
  from  MonthlyRollupDates
  order by Calendardate desc
  
  return
  end
  GO
  </code></pre>
  
  <p>The error I'm getting is</p>
  
  <blockquote>
    <p>Select statements included within a function cannot return data to a
    client</p>
  </blockquote>