I’ve not done a ton of reporting, so I’m not sure if this is a bug or working as intended, but it has caused significant frustration for me this morning.
I’m currently trying to run a query that works just fine outside of the reporting environment, and find that columns that start with (or are entirely numeric) have any leading numeric characters dropped.
Here’s the Query:
Select MAX(DateName(Month, T_Stamp)) [Month],  = round(sum(case when datepart(year,t_stamp) = '2017' then TotalDaily else 0 end),0, 1), [20Seven17] = round(sum(case when datepart(year,t_stamp) = '2018' then TotalDaily else 0 end),0, 1), [Twenty17] = round(sum(case when datepart(year,t_stamp) = '2019' then TotalDaily else 0 end),0, 1) from totaldaily WHERE tag = 'meter' group by DatePart(Month, T_Stamp) Order By Case When month(t_stamp) <= month(GetDate()) Then month(t_stamp) +12 ELSE month(t_stamp) END
And here’s a quick screenshot of the resulting data:
You can see that the entirely numeric column name was dropped entirely.
I can escape this issue by adding a leading alpha or space (punctuation does not work).
Thoughts on what’s going on here?