title: variable column names in sql table valued function
body: <p>Suppose that I am using a sql server to keep track of all my personal expenses and that I am tagging everything with a date and a category.  </p>
  
  <p>This allows me to do things like aggregate monthly expenses per category and look at the last several months of expenses with each category as a row and the most recent months as columns.  </p>
  
  <p>What I am stuck on is the fact that I am having to name the columns things like "most recent month", "previous month", and "2 months ago".  I would really prefer to be able to name them something like "Jan10", "Feb10", or "Mar09" or something like that and have them update automatically every month.  </p>
  
  <p>Calculating the names is simple enough, but I'm not sure how to get sql server to interpret a formula or join or anything like that as the alias for a column.  </p>
  
  <p>Any insights on this one?  </p>