The problem with this query is that if the "PrimaryOrSecondary" is blank or null then the entire record doesn't show. What I need is for the record to show regardless and if there is primary insurance entered show that data otherwise it should be blank.SELECT Patient.MRNum, Patient.Compined, Patient.DOB, Patient.Sex, PatientStatus.Date, PatientStatus.DischargedDate, PatientStatus.Status, Patient.ClientID, Client.ClientName, PatientInsurance.InsuranceNumber, PatientInsurance.PrimaryOrSecondary, contact.CompanyName FROM Client Client INNER JOIN (Patient Patient FULL OUTER JOIN PatientStatus PatientStatus ON Patient.MRNum = PatientStatus.MRNum2 AND Patient.ClientID = PatientStatus.Clientid2 FULL OUTER JOIN (PatientInsurance PatientInsurance INNER JOIN contact contact ON PatientInsurance.InsuranceID = contact.id ) ON Patient.ID = PatientInsurance.PatientID ) ON Client.ID = Patient.ClientID WHERE PatientStatus.RptMonth = 7 AND PatientStatus.RptYear = 2014 AND PatientInsurance.PrimaryOrSecondary = 'Primary' AND Patient.ClientID = 5001
This is the result I get now...This is the result I want...Mike Brown