Records Duplicating after a Join



I have two tables as follows:

Orders (ORDERID, CODE, ORDERQTY)
and
STOCK (CODE, LOCATION, STOCKQTY).

I am running a query that will display all the records in the Orders table,
and also a valid location for that code i.e. Fields returned are:

ORDERID, CODE, ORDERQTY, LOCATION

I am using an INNER JOIN to get the result.

This is fine if there is only one location per code but if I have multiple
locations for a code then the result set will show all locations (therefore
duplicating rows).

How do I just display one location code for each record in the orders table?
I dont mind which location code it is - I just need to avoid having multiple
records returned!

Thanks,
Wez

.



Relevant Pages

  • Re: Records Duplicating after a Join
    ... >Orders (ORDERID, CODE, ORDERQTY) ... >STOCK. ... >How do I just display one location code for each record in the orders table? ...
    (microsoft.public.sqlserver.mseq)
  • Re: Give user ability to copy last record?
    ... The problem is, if the OrderID is an autonumber, how do you determine the ... the form will display the first record in the ... ShipperID, CustPOnum, InvoiceNo, OrderDate, RequiredDate, ShippedDate, ... Set rsobj = CurrentDb.OpenRecordset'target table ...
    (microsoft.public.access.modulesdaovba)
  • Re: Give user ability to copy last record?
    ... The problem is, if the OrderID is an autonumber, how do you determine the ... to have the recordsource sorted on OrderID Descending. ... the form will display the first record in the ... Set rsobj = CurrentDb.OpenRecordset'target table ...
    (microsoft.public.access.modulesdaovba)
  • Re: Display only one value where there are more than one values for the first table
    ... Load it into a DataReader, then display it in a text box of a web ... >> LastName OrderID ...
    (microsoft.public.sqlserver.programming)