Results 1 to 6 of 6
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    order desc in selction sql (2000)

    I have this line sql is possible to add other condition:
    order by DESCRIZIONE Dsc

    Set CN = New ADODB.Connection
    CN.Open "Provider=Microsoft.Jet.OLEDB.4.0; " & _
    "Data Source=Cocuments and Settingsoi24683DesktopMAPPA_OKAREA.MDB;"
    Set RS = New ADODB.Recordset
    sSQL = "select * from SPORTELLI where AREA = '" & LISTA & "'"
    RS.Open sSQL, CN, adOpenKeyset, adLockOptimistic

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: order desc in selction sql (2000)

    Have you tried it?

    (You must use DESC instead of DSC if you want to order descending)

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: order desc in selction sql (2000)

    yes, sorry for sintiax DESC to DSC...
    But i dont know in wich part of sql insert the condition and how to:-)

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: order desc in selction sql (2000)

    You could look up the help, or create a query then look at the SQL.
    <code>
    sSQL = "SELECT * FROM SPORTELLI WHERE AREA = '" & LISTA & "' ORDER BY DESCRIZIONE DESC"
    </code>
    Rather easy, isn't it?

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: order desc in selction sql (2000)

    tks as usual...
    But i have read in other part... "if you order by without DESC and use only order by my_filed..." to the defualt the records rae odered by desc, is really?

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: order desc in selction sql (2000)

    The default sort order is ascending: "ORDER BY MyField" is equivalent to "ORDER BY MyField ASC". If you want to sort descending, you MUST specify the keyword DESC: "ORDER BY MyField DESC".

Posting Permissions

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