Forum Discussion
Basic query question - query not returning results from 2 tables
- SVinLVAug 13, 2020Copper Contributor
SELECT [Care Givers].[First Name], [Care Givers].[Last Name], [Classes per pathway].ClassFROM [Care Givers] INNER JOIN [Classes per pathway] ON [Care Givers].Pathway = [Classes per pathway].Pathway;
- Aug 13, 2020
For one thing, there is a missing space in front of the FROM
Could you have defined different data type for the Pathway fields?
Take a look at the attached and compare it with your version.
On a side note, you really should avoid spaces and special characters in field and object names. You may like to browse: https://www.devhut.net/2017/04/20/access-best-practices-and-troubleshooting-steps/
- SVinLVAug 13, 2020Copper Contributor
Hi Daniel - First of all, thank you for the time you took to answer this question. This is the most basic of queries and it's been driving me crazy. I went line by line and compared your database with mine and EVERYTHING was identical. I copied your elements into my database and it ran fine. I copied your SQL into my query and it wouldn't run (I took into account the field name changes). It should have worked. That told me there was probably something wrong with my tables. I rebuilt my tables one field at a time and discovered something was wrong with my CareGivers table. I still have no clue what was wrong because the one I rebuilt is identical to the original (all data types were matching with the same field properties.) I'm going to chalk this up to some stupid bug with my original table. I was stuck with my problem solving and your response REALLY helped. THANK YOU! Daniel_Pineault