Results 1 to 3 of 3

Thread: A Quickie

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Location
    Leicester, England (City of Kings)
    Posts
    156

    A Quickie

    I've been attempting to relate two recordsets in order to take advantage of the relational aspects of my database.

    This wasn't terribly difficult in the end, & I've managed to create a recordset that I'm happy with. The problem is that I'd like to use the SQL ORDER BY function to order the recordset by [JOB NUMBER]. However, I'm finding it hard to get the correct syntax because of the other elements I've had to put into my query. Does anyone have a quick fix?

    The code is below.

    Thanks.

    Sam

    VB Code:
    1. ClientIndex = rec3ClientDetails("ID")
    2.  
    3.     str2Query = "SELECT * FROM [RECORDDETAILS] WHERE [CLIENT DETAILS] = " & ClientIndex
    4.    
    5.      Set rec3IndivRecords = dba3Database.OpenRecordset(str2Query, dbOpenDynaset)

  2. #2
    Fanatic Member
    Join Date
    Sep 2000
    Location
    Over There
    Posts
    522
    [Highlight=VB]

    str2Query = "SELECT * FROM [RECORDDETAILS] WHERE [CLIENT DETAILS] = " & ClientIndex & " order by <fieldname>"

    is this what you are talking about??

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Location
    Leicester, England (City of Kings)
    Posts
    156
    I think it might just well be. I was trying to arrange the phrase in every possible way but it wasn't working. I haven't tried this one & it seems to make a lot of sense.

    Thanks.

    I'm off to plug it in & see what happens.

    Sam

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