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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Statement brainbuster...

Status
Not open for further replies.

JonWolgamuth

Technical User
Apr 19, 2001
53
US
Not sure who wants to help me tackle this one, but I'll start out with the entirely too huge SQL Statement.

SELECT TransactionsTBL.TransactionID, OptionGroupTBL.OptionGroupID, OptionGroupTBL.OptionGroupName FROM OptionGroupTBL INNER JOIN TransactionsTBL ON OptionGroupTBL.OptionGroupName = TransactionsTBL.TransactionCategory WHERE (((OptionGroupTBL.OptionGroupID)=[Forms]![WorkFRM]![TransactionCategories].[Value]));

If I understand things correctly (questionable), I should be looking to get a result based upon the first section after SELECT statement (TransactionsTBL.TransactionID). Problem is that TransactionsTBL.TransactionID is a list of actual transactions, not a list of numbers. The results I'm getting from this is 1s, 2s, 3s, and 4s (Apparently the value of the Option group?) I'm looking to get, as I said before, the Transaction ID (actualy names of the transactions).

Anyone see what I'm doing wrong? I hope my description was clear...
 
See if this does it.
---------------------
SELECT OptionGroupTBL.OptionGroupID, OptionGroupTBL.OptionGroupName
FROM TransactionsTBL INNER JOIN OptionGroupTBL ON TransactionsTBL.TransactionID = OptionGroupTBL.OptionGroupID
WHERE (((OptionGroupTBL.OptionGroupID)=[Forms]![WorkFRM]![TransactionCategories].[Value])); DougP, MCP

Visit my WEB site to see how Bar-codes can help you be more productive
 
Thanks for the stab DougP, but I don't think I gave you a full enough picture of my situation.

Your statement gets me a "type mismatch in JOIN expression" error. I have 4 OptionGroupIDs (1-4), 4 OptionGroupNames (Processing, Maintenance, Selection, Phones), 33 Transactions (1-33), and 33 TransactionIDs (all names of transactions). (I realize I haven't made this very parallel) Transaction Category (from the TransactionsTBL) equats to the OptionGroupName (from the OptionGroupTBL).

<reaching for the Ibuprofen>

Jon
 
DougP, here's what I have right now. I'm getting the proper display, but the OptionGroupID is getting entered to my table rather than TransactionID.

SELECT OptionGroupTBL.OptionGroupID, TransactionsTBL.TransactionID, OptionGroupTBL.OptionGroupName FROM OptionGroupTBL INNER JOIN TransactionsTBL ON OptionGroupTBL.OptionGroupName = TransactionsTBL.TransactionCategory WHERE (((OptionGroupTBL.OptionGroupID)=[Forms]![WorkFRM]![TransactionCategories].[Value])) ORDER BY TransactionsTBL.TransactionID;

Thank you much for your help!

Jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top