Invoice Query

mws5872

New member
Local time
Today, 14:27
Joined
Jan 26, 2005
Messages
9
This may seem very simple but I need some help.

I have two tables I want to use:

Table 1: open invoices
I want to use this as the base table to check against

Table 2: invoices for a month containing all details.


I want to use column 5 in table 2 to bump against 1 and matching numbers from table 2 will be returned in a query with all the column details from table 2. The problem is column 5 has duplicate invoices so it can't be set as PK. If these duplicate invoices match on the open invoice report they must be included as well...

I also ran into problems importing table 2. I had some type conversion errors when importing... I tried to change all columns to text in excel it helped a little bit.... In Access when importing the data type is greyed out... any suggestions...


Like I said I am sure this is easy for you pros...
 
Just join on column five (you don't have to have a PK to do a join).

Code:
SELECT * from table2 inner join table1 on table2.invoiceNum=table1.invoiceNum

This will return all records from table2 where there is a corresponding invoiceNum in table1.
 

Users who are viewing this thread

Back
Top Bottom