Results 1 to 4 of 4
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SQL Help (97 SR2)

    Good Day Fellow Loungers,

    I've built a query to count the various numbers on a monthly basis. Is there a simple way to sort this query by the sequence of the months instead of the alphabetical order?

    Any help would be Greatly appreciated.

    Warmest regards,
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: SQL Help (97 SR2)

    How is the data entered, Drk? If it uses a date, then just add a calculated field to your query using Month([recorddate]) as the expression value and sorting on that expression, where recorddate is whatever date field you have in your table.
    Charlotte

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: SQL Help (97 SR2)

    Ahh.. <img src=/S/bingo.gif border=0 alt=bingo width=15 height=22>

    Works like a charm, one problem tho... It seems I can't order by the month, while keeping the month format in "MMMM"... it chokes on it for some reason...

    Also, I have another problem now, how to limit it to only this year, but I think i've got a method on that from previous posts here... (we hope I can figure SOMETHING out anyways...)

    Thanks millions Charlotte, you're great! <img src=/S/bow.gif border=0 alt=bow width=15 height=15>
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: SQL Help (97 SR2)

    Drk, you don't have to *show* the field you order by. Forget the formatting on that expression and just use Month to get a number for ordering your records. It's OK to use the function in two different expressions in your query, one to show the formatted month name and one for sorting.

    To limit it to the current year (assuming we're talking calendar year here), just put Year([MyDateField]) into and expression and put Year(Date()) into the criteria under it.
    Charlotte

Posting Permissions

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