I have a table billing which has patientid,billamnt,invoicegrp,facilityid.
There is another table patientmedicaredays which has facilityd,patientid,startdt,enddt.
The billing table has one row for a patient.
The patientmedicaredays has multiple rows for a single patient with different values for the startdt and enddt.
Iam trying to get data in such a way to display one row per patient from the billing table and startdt and enddt as
startdt1 to enddt1, startdt2 to enddt2...depending on the coverage days break.The last column coveragedays iam looking to get all the dates concatenated.Some times the enddt is null too.
The query is below:
SELECT b.FacID,b.patid, B.BillAmt, coveragedays
FROM FwReports.dbo.Billing B
left join Pat..PatientMediCareCycles pc on b.facid = pc.facid and b.patid = pc.patid
Iam trying to display the data in crystal xi.