Hello,
I have been trying for days to add more than one database column into a cell but im not having any luck.
Here is my code:
i want to add a column with the header 'Client Name(s)'
and in this column i want to put in:
c1name c1surname
c2name c2surname
is this possible?
I have been trying for days to add more than one database column into a cell but im not having any luck.
Here is my code:
Code:
Dim mortAdapter As New SqlDataAdapter("(SELECT mort_id,mort_date_written,mort_type,mort_repay_method," & _
"mort_deal,mort_company,mort_no,mort_amount,mort_comm,mort_settled,mort_actual_comm," & _
"mort_comm_recd,mort_comm_paid,mort_introducer,mort_completed,mort_application_date,mort_client_id1," & _
"mort_client_id2, c1.client_name as c1name, c1.client_surname as c1surname, " & _
"c2.client_name as c2name " & _
"FROM remortgage " & _
"LEFT JOIN client c1 ON c1.client_id = mort_client_id1 " & _
"LEFT JOIN client c2 ON c2.client_id = mort_client_id2 " & _
"WHERE mort_application_date IS NOT NULL) UNION " & _
"(SELECT mort_id,mort_date_written,mort_type,mort_repay_method," & _
"mort_deal,mort_company,mort_no,mort_amount,mort_comm,mort_settled,mort_actual_comm," & _
"mort_comm_recd,mort_comm_paid,mort_introducer,mort_completed,mort_application_date,mort_client_id1," & _
"mort_client_id2, c1.client_name as c1name, c1.client_surname as c1surname, " & _
"c2.client_name as c2name " & _
"FROM remortgage " & _
"LEFT JOIN client c1 ON c1.client_id = mort_client_id1 " & _
"LEFT JOIN client c2 ON c2.client_id = mort_client_id2 " & _
"WHERE mort_application_date IS NOT NULL)" & _
" ORDER BY mort_application_date DESC", objConnection)
and in this column i want to put in:
c1name c1surname
c2name c2surname
is this possible?
Comment