select [chart],[billing],[service date 1], [provider code],[transaction code], [cpt code],[item],[charge],extended,units from [billing detail]as i where
(i.[transaction Code] = 'PIP' or
i.[transaction Code] = 'APPEA0001' OR
i.[transaction Code] = 'ATTYPYMT' OR
i.[transaction Code] = 'INPRO0000' OR
i.[transaction Code] = 'INTPMTS' OR
i.[transaction Code] = 'LPMT0000' OR
i.[transaction Code] = 'MRPYMT' OR
i.[transaction Code] = 'NONRESP' OR
i.[transaction Code] = 'PARTI0000' OR
i.[transaction Code] = 'PARTI0001' OR
i.[transaction Code] = 'PPCA' OR
i.[transaction Code] = 'PPCC' OR
i.[transaction Code] = 'PPCH' OR
i.[transaction Code] = 'PPIP' OR
i.[transaction Code] = 'PSIO' OR
i.[transaction Code] = 'PTIP' OR
i.[transaction Code] = 'SETTL0000' OR
i.[transaction Code] = 'SETTOPAT' OR
i.[transaction Code] = 'SIP ' OR
i.[transaction Code] = 'STMT' OR
i.[transaction Code] = 'SUPCA' OR
i.[transaction Code] = 'SUPCC' OR
i.[transaction Code] = 'SUPCH' OR
i.[transaction Code] = 'IP' OR
i.[transaction Code] = 'MP' OR
i.[transaction Code] = 'PIP' OR
i.[transaction Code] = 'TIP' OR
i.[transaction Code] = 'VOUCHER' OR
i.[transaction Code] = 'VOUCHPHON' )
and
[service date 1] between '1/1/2009' and '7/31/2010'
and [cpt code]=''
and extended<0
and chart!='overpay'
00001015 16062 2009-05-26 00:00:00.000 AH PIP 5 52.67 -52.67 1
00000296 32952 2010-04-19 00:00:00.000 IPN00 PIP 2 3.43 -3.43 1
There are several rows where [Cpt code] is empty and I want to include those fields also with the join query but these rows are not being displayed coz of join conditions. What should I do?