Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

SQL Query help

$
0
0

Hi all,

I am having an issue with the query for one of our sales reports. We have classes here almost every week and they are coded as classcode-yearmonthday so one of our codes might be GPSRSU-20140210 which would mean that the class "GPSRSU" was given on 2/10/2014.

Up until this year we never had the same class in the same month so we might have GPSRSU and GPCOCO and GPEXWO all in the same month but never GPSRSU twice in the same month so our sales reports would go by month and compare registrations and revenue etc.. to the previous 3 years.

The issue I am having now is we have started having more than one GPSRSU in the same month so for the current year the report is correct but for the previous three years it is duplicating the one GPSRSU so it is throwing all of the totals off.

Here is the query that runs the report (in next post)


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>