Skip to content
Advertisement

How do I convert Months from Numeral to String Form in SQL Query Containing GROUP BY?

So, I’m creating a View that pulls a bunch of data (with a SUM aggregate on one field). The query contains GROUP BY clause and when I do the month conversion in the query as follows, I get an %invalid character% error.

So, for instance, I want to convert ‘1’ in the Month field to ‘January’, ‘2’ to February, so on and so forth.

Advertisement

Answer

I see, you have something called PurchaseMonth and it takes the values 1, 2, 3, etc. You want to convert these to month names. How about this?

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement