Test_ID : SELECT lt.Pname,lt.Age,lt.Gender,plo.ledgertransactionno LabNo, plo.Itemname,plo.BarcodeNo, lom.name ObsName,plr.Reason RepeatReason,em.name RepeatBy, DATE_FORMAT(plr.dtentry,'%d-%b-%y %h:%i') RepeatDate FROM patient_labobservation_opd_rerun plr INNER JOIN patient_labinvestigation_opd plo ON plo.test_id=plr.test_id INNER JOIN f_ledgertransaction lt ON lt.LedgerTransactionID=plo.LedgerTransactionID INNER JOIN labobservation_master lom ON lom.labobservation_id=plr.labobservation_id INNER JOIN employee_master em ON em.employee_id=plr.UserId where plr.dtentry >= @fromDate AND plr.dtentry <= @toDate