I have the below query and I need to add another condition on 'ON' clause.
If I need to include another clause for 'ON' which is
i_no = LEFT(replace(right(filename, charindex('\', reverse(filename))-1),'_rprt%[0-9]%.doc', ''),
How do I achieve this?
SELECT (right(filename, charindex('\', reverse(filename))-1)) phyname,
replace(filename,(right(filename, charindex('\', reverse(filename))-1)), '') phypath,
a_no,
i_no
from
#tempimages
inner join
imagestatus
on
i_no = LEFT(replace(right(filename, charindex('\', reverse(filename))-1),'.doc', ''),
LEN(replace(right(filename, charindex('\', reverse(filename))-1),'.doc', ''))-3)