Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    May 2003
    Location
    Stockholm, Sweden
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ORDER BY Problem

    Hi,

    I have some trouble with my ORDER BY part of my SQL string

    Code:
    ORDER BY tbl_res.Date, tbl_res.varv DESC")
    in this case the DESC doesn't have any effect at all, why??
    If I do delete , tbl_res.varv it will work just fine, what's the difference??

    Is there any workaround for this? I want the last added table to be on top
    but right now it's first added table at top like this:

    2004
    2005

    and Iwant it to be

    2005
    2004

    /Speedy
    Last edited by Speedy; 03-19-2006 at 03:56 AM.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    which field holds the year part, shouldnt it be:
    ORDER BY tbl_res.Date DESC, tbl_res.varv DESC ?
    I am the luckiest man in the world

  • #3
    Regular Coder
    Join Date
    May 2003
    Location
    Stockholm, Sweden
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Roelf,

    Thanks for your answer it worked great.

    What I didn't know was that you could set ASC/DESC for each field and therefor I just had DESC in the end.

    You learn something new each day of your life

    /Speedy


  •  

    Posting Permissions

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