Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.
(SELECT tr.rec as 'RRef', id.item as Product, tr.qty as 'In', '0' as 'Out',
rm.daterec as 'DATE'
FROM details as id
INNER JOIN receive AS tr ON tr.recdes = id.item
INNER JOIN receivedmain AS rm ON rm.rec = tr.rec
WHERE rm.daterec BETWEEN '2020/01/01' and '2020/02/13')
(SELECT tst.transno as 'TReference', i.item as Product, '0' as 'In',
tst.fld_qty as 'Transfer Qty', tmt.fld_transdate as 'DATE'
FROM itemdetails as i
LEFT JOIN subtransfer AS tst ON tst.name = i.item
LEFT join maintransfer as tmt on tmt.transno = tst.transno
WHERE tmt.transdate between '2020/01/01' and '2020/02/13' and
(tmt.status = 4 or tmt.status = 5)) order by DATE