+ Reply to Thread
Results 1 to 3 of 3

Thread: Select data from two tables

  1. #1
    Forum Contributor
    Join Date
    07-16-2009
    Location
    Bucharest, Romania
    MS-Off Ver
    MS Office 2007
    Posts
    157

    Select data from two tables

    I have two tables acc_accounts and lst_lost and a combobox cboUrl.

    I need to select the email fields named ACC_Email and LST_Email where the value from cboUrl exist in either one or both tables. The data could be in both or only one of them.

    I tried something like this:
    SELECT ACC_Email,LST_Email
    FROM (ACC_Accounts
    				LEFT JOIN LST_Lost ON ACC_Accounts.ACC_Url = LST_Lost.LST_Url)
    WHERE [ACC_Url] LIKE [Forms]![ACC_Accounts_frm]!cboUrl AND LST_Url LIKE [Forms]![ACC_Accounts_frm]!cboUrl
    Thank you

  2. #2
    Valued Forum Contributor OnErrorGoto0's Avatar
    Join Date
    12-30-2011
    Location
    I DO NOT POST HERE ANYMORE
    MS-Off Ver
    I DO NOT POST HERE ANYMORE
    Posts
    1,647

    Re: Select data from two tables

    I think you would need a UNION query to extract the fields from both tables, where the url is the one you want.
    Good luck.

  3. #3
    Forum Contributor
    Join Date
    07-16-2009
    Location
    Bucharest, Romania
    MS-Off Ver
    MS Office 2007
    Posts
    157

    Re: Select data from two tables

    Right. Thanks man. I didn't know where my head was.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0