moradisndat
Registered User.
- Local time
- Today, 09:56
- Joined
- Mar 27, 2015
- Messages
- 14
I have 3 tables. The field in red is the problem area.
tblTypes: (PK)TypeID, Type
tblAccounts: (PK)AcctID, (FK)TypeID, AcctName
tblJournalEntries: (PK)JournalID, Date, (?)TypeID, (FK)AcctID, Amount
screenprint uploaded here if it helps--> h t t p ://imgur.com/ktRdNNE
So my confusion is with tblJournalEntries. I don't think I have it set up correctly. I want to be able to select TypeID (expense, income, etc) and have AcctNames show only the matching TypeID.
SELECT [tblAccounts].[AcctID], [tblAccounts].[AcctName] FROM [tblAccounts] ORDER BY [AcctName]; shows all accounts regardless of type.
I tried using this but the field came up blank: SELECT DISTINCTROW [tblAccounts].[AcctID], [tblAccounts].[AcctName] FROM tblAccounts WHERE ((([tblAccounts].[TypeID])=[tblJournalEntries].[TypeID] ORDER BY [AcctName]));
Any help or suggestions would be much appreciated. Thanks.
tblTypes: (PK)TypeID, Type
tblAccounts: (PK)AcctID, (FK)TypeID, AcctName
tblJournalEntries: (PK)JournalID, Date, (?)TypeID, (FK)AcctID, Amount
screenprint uploaded here if it helps--> h t t p ://imgur.com/ktRdNNE
So my confusion is with tblJournalEntries. I don't think I have it set up correctly. I want to be able to select TypeID (expense, income, etc) and have AcctNames show only the matching TypeID.
SELECT [tblAccounts].[AcctID], [tblAccounts].[AcctName] FROM [tblAccounts] ORDER BY [AcctName]; shows all accounts regardless of type.
I tried using this but the field came up blank: SELECT DISTINCTROW [tblAccounts].[AcctID], [tblAccounts].[AcctName] FROM tblAccounts WHERE ((([tblAccounts].[TypeID])=[tblJournalEntries].[TypeID] ORDER BY [AcctName]));
Any help or suggestions would be much appreciated. Thanks.