i have a table like this:

doc_no,partno,transdate,transcode,qty,forprod,...
doc1,partno1,date11,issue,qty11,prod1
doc1,partno2,date11,issue,qty21,prod1
...
docN1,prod1,dateN1,receive,qtyN1,null
docN2,prod1,dateN2,receive,qtyN2,null
...

now i need to generate report like this:

product: prod1 manufactured qty: sum(qtyN) where transcode='receive'

item date qty
partno1 date11 qty11
date12 qty12
date13 qty13
partno2 date21 qty21
date22 qty22
date23 qty23
...
where transcode = 'issue'

is there anyway to do this in a single query?

taking in mind the report might be generated for date range...

please help!!!