Using Access 2000
Below is my SQL. The problem part is the SubQuery that I have entered in bold print.
Here is the situation...
I have two tables, "tblMiscellaneousDonations" and "tblNewGivings." Each table has a field called ToFund.
I want to be able to pull all records from tblMiscellaneousDonations where the ToFund field entries match the ToFund entries in tblNewGivings. BUT this is the difficulty...the entries may not be exactly the same.
For example, in tblMiscellaneousDonations an entry is "Heritage" whereas in tblNewGivings the entry is "Heritage Fund."
How do I modify the SubQuery part of the SQL to ensure that all records are pulled?
I have tried various forms of Like but, so far, to no avail.
Thanks.
Tom
Below is my SQL. The problem part is the SubQuery that I have entered in bold print.
Code:
SELECT tblMiscellaneousDonations.RecordID, tblMiscellaneousDonations.LastName, tblMiscellaneousDonations.FirstName, tblMiscellaneousDonations.Amount, tblMiscellaneousDonations.ToFund, Year([DonationDate]) AS YearToCheck, tblMiscellaneousDonations.DonationDate
FROM tblMiscellaneousDonations
WHERE (((tblMiscellaneousDonations.ToFund) [b]In (SELECT ToFund
FROM tblNewGivings))[/b] AND ((Year([DonationDate]))=[Forms]![frmYearChecker]![txtYearPicker]))
ORDER BY tblMiscellaneousDonations.RecordID, tblMiscellaneousDonations.LastName, tblMiscellaneousDonations.FirstName;
Here is the situation...
I have two tables, "tblMiscellaneousDonations" and "tblNewGivings." Each table has a field called ToFund.
I want to be able to pull all records from tblMiscellaneousDonations where the ToFund field entries match the ToFund entries in tblNewGivings. BUT this is the difficulty...the entries may not be exactly the same.
For example, in tblMiscellaneousDonations an entry is "Heritage" whereas in tblNewGivings the entry is "Heritage Fund."
How do I modify the SubQuery part of the SQL to ensure that all records are pulled?
I have tried various forms of Like but, so far, to no avail.
Thanks.
Tom