Not clear about what you are asking for here. But try:
Select x,x,x,x into tmp_table
from Deductions D Join DedType DT on D.Dedcode =DT.DDedCode
where D.DedType='Den' and D.DStatus ='A' and
Not Exist (select TOP 1 1 from Deductions join Dedtype on Dedcode=DDedCode where dedtype='Med' and eedbenstatus ='A'
AND DedCode = D.DedCode)
Also, I have aliased the tables just randomly, as you have not provided which column bleongs to which table. So Some sample data would help.
Please mark as answer if this answers your question. Please mark as helpful if you found this post helpful.
Microsoft is conducting an online survey to understand your opinion of the Technet Web site. If you choose to participate, the online survey will be presented to you when you leave the Technet Web site.