Got it (I hope).
SELECT Feb1.BaseNum, Feb1.SupplierCode, Feb1.field18
FROM Feb1 INNER JOIN Jan1 ON (Feb1.BaseNum = Jan1.BaseNum AND
Feb1.SupplierCode = Jan1.SupplierCode);
To create a query using the SQL above, create a new query in design view,
but DON'T add any tables. Just click close on the Show Table dialog box.
Your design view will then drop-down menu will now show an SQL option.
Select this and you'll be given a blank screen with SELECT; written in it.
Delete this an enter the SQL above.
You'll need to make some changes to accommodate your table names and fields,
but it should work. :)
Okay, let me drop a bit more detail. Here is query design view:
Item Price
SupplyCode
PurchTbl PurchTbl
PurchTble
Like "*" & [Enter base number] & "*" [Enter
code]
This query works great when I enter in a base number and code and it returns
price along with some other information. However, I would like to be able to
pull a few hundred of these at the same time. I have a table called BaseNbrs
with two fields: BaseNbr and Code. The BaseNbr, which looks like W1234 is a
part of the whole Item such as 123W1234-001. The code I enter matches the
whole supply code field so there is no problem with a partial entry there.
I was hoping that somehow the query could call each row of data from the
table and enter it in the appropriate criteria row and then I would get 200
prices for 200 rows of data. Unfortunately, I can only link the two on the
supply code field as BaseNbr is only a part of Item. Does that make sense?
> Got it (I hope).
>
[quoted text clipped - 11 lines]
> You'll need to make some changes to accommodate your table names and fields,
> but it should work. :)
Walter - 26 Oct 2007 19:32 GMT
Never mind, I figured it out for myself... Thanks for the ideas.
> Okay, let me drop a bit more detail. Here is query design view:
>
[quoted text clipped - 32 lines]
> > You'll need to make some changes to accommodate your table names and fields,
> > but it should work. :)