Query needs tables switched

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Scott B (scottb_at_cecomet.net)
Date: 03/05/05


Date: Sat, 5 Mar 2005 11:51:35 -0500

Greetings,

I have two tables, one is list of names and the other is list of
organizations. More than one person can belong to one organization. And
each person can only belong to one organization. I want a query that joins
names to organizations. I want to ultimately create a form to enter names
into organizations for invoice purposes. When I make a query it always
creates it backwards in my mind. I believe this is true because after
making the query I go to Forms and the Form Wizard subform and linked table
functions always use the names as the main form and I want the organization
as the main form. What am I doing wrong? Here is the SQL of the query if
it helps. "tblLUBillToContact" is the names table and "tblLUBillTo" is the
organization table.

Many thanks,
Scott B

SELECT tblLUBillToContact.Contact, tblLUBillTo.Organization,
tblLUBillTo.Department, tblLUBillTo.BillAddress1, tblLUBillTo.BillAddress2,
tblLUBillTo.BillCity, tblLUBillTo.BillState, tblLUBillTo.BillProvince,
tblLUBillTo.BillPostalCode, tblLUBillTo.BillCountry
FROM tblLUBillTo INNER JOIN tblLUBillToContact ON
tblLUBillTo.BillToContactID = tblLUBillToContact.BilltoContactID
ORDER BY tblLUBillTo.Organization;



Relevant Pages

  • Re: LDAP Query Search Help in AD 2003
    ... Should be a fairly expensive query though. ... > I am able to get it to list all members not in one group, ... > belong to group A or group B. You see, they need to belong to one or the ... >>> Exchange Mailbox Recipients who do not belong to either Distribution ...
    (microsoft.public.windows.server.active_directory)
  • Re: Hundreds of columns, index on all of those.
    ... Scalability would not be so good, if there would be separate tables ... And the performance problem (related to the query) might still exist ... First fetch a set of Item IDs. ... Different Items can belong to one group. ...
    (comp.databases)
  • Re: Running a Query to Obtain One of Multiple Values in a Field
    ... organize the contacts into correct groups for an email list. ... The problem I am having is that when I try to sort or query to pull up ... they belong to another one as well. ...
    (microsoft.public.access.queries)
  • Re: Top Ten PHP Security Hole
    ... For example, in the above case, only 2 records are belong to ... And if the user2, manipulate the url like ... I avoid this issue with the query like (so that he can delete his ...
    (comp.lang.php)
  • Re: Query needs tables switched
    ... How do I get Access to set a foreign key? ... The tblLUBillToContact should have ... > foreign key in your join query. ... > FROM tblLUBillTo as O INNER JOIN tblLUBillToContact as C ...
    (microsoft.public.access.queries)