The below query will return something like thisCombined.....InsuranceNumber....CompanyNameJohn Smith...5555555................MedicareJade White...7878787................MedicalIf insurance doesn't equal 'Primary' or is NULL then the entire record doesn't show. What I want is for the records from Patient to appear even if no primary insurance was entered or if the insurance entered equals 'Primary'. Combined.....InsuranceNumber....CompanyNameJohn Smith...5555555................MedicareMike Brown...5656565................Jade White...7878787................MedicalSELECT Patient.ClientID, Patient.ID, Patient.MRNum, Patient.Compined, PatientStatus.Status, PatientStatus.Date, PatientStatus.DischargedDate, Patient.PrimDiag, PatientInsurance.InsuranceNumber, contact0.CompanyName, PatientLocation.Location4, PatientLocation.NPI AS NPI1 FROM (Patient Patient INNER JOIN PatientStatus PatientStatus ON Patient.MRNum = PatientStatus.MRNum2 AND Patient.ClientID = PatientStatus.Clientid2 INNER JOIN (PatientInsurance PatientInsurance INNER JOIN contact contact0 ON PatientInsurance.InsuranceID = contact0.id ) ON Patient.ID = PatientInsurance.PatientID INNER JOIN PatientLocation PatientLocation ON Patient.ID = PatientLocation.Patientid4 ) WHERE (PatientStatus.Status NOT IN ('Pending', 'Non-Admit') ) AND Patient.Record_delete <> 1 AND PatientInsurance.PrimaryOrSecondary = 'Primary' ORDER BY Patient.Compined
Mike Brown