AlanJordan
Programmer
I have a data entry form Companies, with a subform Contacts.
In the subform I have a place for each contact name. I also have a field MayCallBack, into which a date is entered.
I am able to generate a report with this SQL:
The problem is that I would also like to include the CompanyName. I'm not sure how to do this because when I create this SQL, I get an empty dataset.
I have a feeling that I need to build a subquery, but I'm not sure how to proceed.
Any suggestions?
In the subform I have a place for each contact name. I also have a field MayCallBack, into which a date is entered.
I am able to generate a report with this SQL:
Code:
SELECT Contacts.LastName, Contacts.FirstName, Contacts.Phone, Contacts.MayCallBack, Contacts.HowUseHS
FROM Contacts
WHERE (((Contacts.MayCallBack) Is Not Null))
ORDER BY Contacts.MayCallBack DESC;
The problem is that I would also like to include the CompanyName. I'm not sure how to do this because when I create this SQL, I get an empty dataset.
Code:
SELECT Companies.Company, Companies.MayCallBack, Contacts.LastName, Contacts.FirstName, Contacts.Phone, Contacts.HowUseHS
FROM Companies INNER JOIN Contacts ON Companies.CompanyID = Contacts.CompanyID
WHERE (((Companies.MayCallBack) Is Not Null))
ORDER BY Companies.MayCallBack DESC;
I have a feeling that I need to build a subquery, but I'm not sure how to proceed.
Any suggestions?