copy and paste this code into a new query
Code:
SELECT table1.[Procedure ID], table1.[Patient ID], table1.Hospital, table1.[In/Out Patient], table1.[Procedure 1], table1.[Procedure 2], table1.SubProc, table1.SubPro2, table1.SubPro3, table1.SubPro4, table1.SubPro5, table1.SubPro6, table1.SubPro7, table1.SubPro8, table1.Comment, table1.Diagnosis, table1.[Diagnosis 2], table1.[Diagnosis 3], table1.[Diagnosis 4], table1.Date, table1.Colonoscopy, table1.EGD, table1.ERCP, table1.[Small Bowel], table1.MISC, table1.Colonoscopy2, table1.Colonoscopy3, table1.EGD2, table1.EGD3, table1.ERCP2, table1.ERCP3, table1.[Small Bowel2], table1.[Small Bowel3], table1.MISC2, table1.MISC3, Colonoscopy.Service, Colonoscopy_1.Service, Colonoscopy_2.Service
FROM ((table1 LEFT JOIN Colonoscopy ON table1.Colonoscopy = Colonoscopy.Price) LEFT JOIN Colonoscopy AS Colonoscopy_1 ON table1.Colonoscopy2 = Colonoscopy_1.Price) LEFT JOIN Colonoscopy AS Colonoscopy_2 ON table1.Colonoscopy3 = Colonoscopy_2.Price
WHERE (((table1.Date) Between [start] And [end]));
You also need to correct the datatype for the Colonoscopy field - it is type text and should be type number (long integer).
Other things:
- using non alpha numeric characters in field names is a bad idea (In/Out Patient). , it is prone to creating misleading errors
- using reserved words such as Date is also a bad idea - Date is a function that returns today as a date , it is prone to creating misleading errors
- although you can have spaces in field names, it is prone to creating misleading errors
- You really should look at normalising your data - Procedures, SubProc, Diagnosis, Colonoscopy, Small Bowel, Misc are all indicative of a poorly designed database which requires much more complex queries, form and report design etc, perhaps so complex they cannot even be created.