I have a query that lists the aggregate Month and DateName by month in two separate fields. I would like to merge these together so this query displays like so:
2009 1-January
2009 2-February
etc.
Is this possible?
2009 1-January
2009 2-February
etc.
Code:
SELECT 'Year'=Year(vtr."Billing Date"),
'Month'=Month(vtr."Billing Date"),
'Monthy'=DateName(month, vtr."Billing Date"),
'Count'=COUNT(vtr.[Order Number]),
'Miles'=SUM(vtr."TotalMiles"),
'Total Cost'=SUM(vtr.TotalARAmt)
FROM DB1.dbo.tvr AS vtr
WHERE vtr."CustomerShortName"=N'COMPANY'
AND (vtr."Billing Date">= CONVERT(DATETIME, '2009-01-01 00:00:00', 102))
AND (vtr."Billing Date"< DATEADD(MONTH, DATEDIFF(MONTH, 0, CURRENT_TIMESTAMP), 0))
GROUP by Year(vtr."Billing Date"), Month(vtr."Billing Date"), DateName(month, vtr."Billing Date")
Is this possible?