SQL Server getting Column Name form results in a Select query
I am trying to name my columns from the results of a Select query using date information and variables but I am probably expecting to much from my simple query. My Table HstTotals is laid out as below: