I am using the query which merges date column and amount column into a string, but as we are querying it by policy number, it is getting many rows, my thing is to merge these different values of the columns to one.
example:
2014/09/01 733.00
2012/08/01 322.02
so these are the different rows for one policy number, now I want them to be also in one single string as :
2014/09/01 733.00 2012/08/01 322.02
If they are two rows, then also the value of my column should merge all the values of dates and amounts into single string for that particular policy number.
The query I am using is :
SELECT
LEFT(CONVERT(VARCHAR, BSD.BILL_SCH_DTL_BILL_DT, 111), 10)
+ ' '+ CONVERT (VARCHAR(50),BSD.BILL_SCH_DTL_DRV_AMT ,128)Schedule_pymts, *
From POLICY_PERIOD_BILLING_SCHEDULE PB
JOIN BILLING_SCHEDULE_DETAIL BSD
ON BSD.PLCY_PRD_BILL_SCH_ID = PB.PLCY_PRD_BILL_SCH_ID
AND BSD.BILL_SCH_DTL_DRV_AMT <> 0
AND BSD.VOID_IND = 'n'
but this only merges one month and one amount together, but I need all the months of amount to be in one string(column) for that particular policy number.