Unanswered: YTD vs Last Year YTD Comparison in a Graph
I'm trying to do a graph of this vs last year info (possible a line graph). I have a single table with field for MonthYear (e.g. Jan 06), and Value. Is there a way I can put this into 2 overlapping line graphs? Thanks
I would say you will have more problems in the future - I don't think that is ideal design for storing the month and year. Personally, I would probably either have a month column and a year column or (more likely) a date column, using the first day of the month as a way of arbitraraly forcing a date (01/01/2005, 01/02/2005, 01/03/2005 etc - dates in DD/MM/YYYY format).
However - assuming the data is always "mmm yy" then:
SELECT MID(MonthYear, 1, 3) AS TheMonth, MID(MonthYear, 5, 2) AS TheYear, Value
Note however you will now need to figure out correct ordering as you have used a text rather than numeric (as Date actually is) data type.
Well, I'm not storing the date this way, it's actualy a query in already desired format. I didn't want to bother people with all the details. The question is how I can have overlapping 2 serieses in one grap. Anybody?