techgirl10
IS-IT--Management
I have a query that I run monthly that contains a rolling 18 months of data. Therefore, the oldest month will drop off and a new month will be added so the months and years will change. I want to rename the fields a generic name such as Month1, Month2, etc. Can I do this in SQL?
This is my SQL text:
SELECT Rate2006.Rating, Rate2006.[07/2006], Rate2006.[08/2006], Rate2006.[09/2006], Rate2006.[10/2006], Rate2006.[11/2006], Rate2006.[12/2006], Rate2007.[01/2007], Rate2007.[02/2007], Rate2007.[03/2007], Rate2007.[04/2007], Rate2007.[05/2007], Rate2007.[06/2007], Rate2007.[07/2007], Rate2007.[08/2007], Rate2007.[09/2007], Rate2007.[10/2007], Rate2007.[11/2007], Rate2007.[12/2007] INTO tblMakeCaseOverallRate
FROM Rate2006 INNER JOIN Rate2007 ON Rate2006.Rating = Rate2007.Rating
ORDER BY Rate2006.Rating;
Any ideas would be greatly appreciated. Thanks!
This is my SQL text:
SELECT Rate2006.Rating, Rate2006.[07/2006], Rate2006.[08/2006], Rate2006.[09/2006], Rate2006.[10/2006], Rate2006.[11/2006], Rate2006.[12/2006], Rate2007.[01/2007], Rate2007.[02/2007], Rate2007.[03/2007], Rate2007.[04/2007], Rate2007.[05/2007], Rate2007.[06/2007], Rate2007.[07/2007], Rate2007.[08/2007], Rate2007.[09/2007], Rate2007.[10/2007], Rate2007.[11/2007], Rate2007.[12/2007] INTO tblMakeCaseOverallRate
FROM Rate2006 INNER JOIN Rate2007 ON Rate2006.Rating = Rate2007.Rating
ORDER BY Rate2006.Rating;
Any ideas would be greatly appreciated. Thanks!