Results 1 to 4 of 4

Thread: Joining fields in two table together.

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    455

    Post

    Dear VB programmers,


    Can someone please tell me the syntax to join two tables:

    In database "C:\Q.MDB"

    Content of Q.MDB:

    Tables Fields
    Cities Street
    Town

    Names Street
    NickName

    Source:

    Dim DBS As Database
    Dim RS As Recordset

    Set DBS = OpenDatabase("c:\q.mdb")
    Set RS = DBS.OpenRecordset("???????????????")

    What do I have to fill in on the quetion marks if I want to join Cities.street with Names.street?

    Nice greetings,

    Michelle.

  2. #2
    Lively Member
    Join Date
    Jan 2000
    Location
    Springfield, IL
    Posts
    124

    Post

    Code:
    Set RS = DBS.OpenRecordset("Select Cities.Street, Cities.Town, Names.NickName FROM Cities, Names WHERE Cities.Street = Names.Street")
    I am not sure if this is what your getting at or not.

  3. #3
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238

    Post

    you can always use the LEFT/RIGHT JOIN to join two or more fields from different table. All the help can be obtain by press F1 key.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    455

    Post

    Hello all,

    Thanks a lot for the usefull information.

    Michelle

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