There is nothing complex about this, or I might be missing something... create a procedure that accepts your parameters and returns resultset of the following query:
select
c1.accountno
,c1.company
,c1.contact
,cal.accountno
,cal.ondate
,cal.userid
,cal.rectype
,hist.accountno
,hist.ondate...