Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2002
    Location
    Oakland, CA
    Posts
    126

    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

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi

    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:
    Code:
    SELECT MID(MonthYear, 1, 3) AS TheMonth, MID(MonthYear, 5, 2) AS TheYear, Value
    FROM MyTable
    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.

    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Nov 2002
    Location
    Oakland, CA
    Posts
    126
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •