Hi, I have the following select code which works fine..SELECT TOP (100) PERCENT dbo.qryPatientInfoDUMP.PatID, dbo.qryPatientInfoDUMP.PatEID, dbo.qryPatientInfoDUMP.PracticeGPID, GPRDTech.gprdsql.TblPracDetails.GoldPracID, dbo.tblpatdetails_May.vision_patid, dbo.tblpatdetails_May.goldpracid AS GOLDPRACIDnwFROM GPRDTech.gprdsql.TblPracDetails INNER JOIN dbo.qryPatientInfoDUMP ON GPRDTech.gprdsql.TblPracDetails.prac_eid = dbo.qryPatientInfoDUMP.PracticeEID AND GPRDTech.gprdsql.TblPracDetails.prac_no = dbo.qryPatientInfoDUMP.PracticeGPID INNER JOIN dbo.tblpatdetails_May ON dbo.qryPatientInfoDUMP.PatID = dbo.tblpatdetails_May.vision_patid AND GPRDTech.gprdsql.TblPracDetails.GoldPracID = dbo.tblpatdetails_May.goldpracid
Now, I want to order by GPRDTech.gprdsql.TblPracDetails.GoldPracID.. the problem am facing where ever I add order by GPRDTech.gprdsql.TblPracDetails.GoldPracID .. I receive the SQL Execution Error - Timeout Expired... Secondly, I want dbo.tblpatdetails_May.vision_patid to be case sensitive.. Therefore, for example for dbo.qryPatientInfoDUMP.PatID = 00XL ONLY record with 00XL from dbo.tblpatdetails_May.vision_patid displayed. Presently, it output 00XL , 00xL, 00Xl, 00xl.. Therefore, 4 records instead..Any help please will be greatly appreciated.. Thanks