i think query is unclear
Transcation tbl has transcationdate, amount and cid
Mas_C has cid and cname
Transcation date displayed will be from & todate passed from the application
1) the output needed is in all conditions
transcationdate, amount
if @<>type''
output shld be transcationdate, amount
if @cid<>''
output shld be transcationdate, amount cname