Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Matching Records Query 1

Status
Not open for further replies.

beer13

Technical User
Mar 13, 2006
4
US
I am perplexed by what should be way too easy.
I am trying to find records from table A - stock number that appear in table B - stock number.

Thanks for the help!
 
SQL code:
SELECT A.*
FROM [table A] AS A INNER JOIN [table B] AS B
ON A.[stock number] = B.[stock number]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks! I am getting a syntax error in the Join operation. Sorry I am just learning this.

SELECT SalesPeriod.[Stock#], SalesPeriod.SaleDate, SalesPeriod.Status, SalesPeriod.Sales1, SalesPeriod.Profit
FROM [SalesPeriod] AS A INNER JOIN [RedTag] AS Redtag
ON SalesPeriod.[stock number] = Redtag.[stock number];
 
Probably something like this:
SELECT SalesPeriod.[Stock#], SalesPeriod.SaleDate, SalesPeriod.Status, SalesPeriod.Sales1, SalesPeriod.Profit
FROM SalesPeriod INNER JOIN RedTag
ON SalesPeriod.[Stock#] = Redtag.[Stock#];

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Well, that got rid of the error, thanks, however I do not get any matching records and there are plenty. Any thoughts?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top