Results 1 to 2 of 2

Thread: SELECT ORDER BY with ADO

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Location
    Ontario, Canada.
    Posts
    85

    Smile

    I want to be able to order my records by the day of the week. Meaning I want to sort by date, but just by the day of the week, all Monday's together, all Tuesdays together,etc.

    With DAO I could use the recordset property sort.
    Like This:

    temprecset.sort = "WeekDay(Date)"

    Using the VB function WeekDay.

    But with ADO I can't use the sort function.

    Any ideas??????

    Thanks in advance.

    I figured it out myself. I didn't realize that you could just insert the VB Function right into the Select statement itself and it would work fine.

    Thanks anyway


    [Edited by Jimmer on 06-15-2000 at 02:53 PM]

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    According to the HitchHikers Guide to VB and SQL server:
    "The sort property [of an ADO recordset] specifies how to order the rows in the recordset. This property is a string of comma-delimited Field names separated by an optional space and ASCENDING or DESCENDING. Actually, ADO seems to prefer DESC and ASC but this might be a bug".

    an example given:

    RS.Sort = "title, DESC, pub_ID" for the pubs.Titles table in SQL Server.

Posting Permissions

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



Click Here to Expand Forum to Full Width