left join with between date condition
Posted: Thu Dec 06, 2012 8:45 am
Hi,
I need help in implementing following join logic.
Select * from Table A
Left outer join table B
on A.column1 = B.column1
and ((A.date1 between B.date1 and B.date2) or (A.date2 between B.date1 and B.date2))
First I used a Join and then used filter after that for date condition, but it gives me a wrong result.
Here both table A and B are files.
I under stood that left join and both date conditions should be done within Join.
Please let me know if there is way to get the correct result.
I need help in implementing following join logic.
Select * from Table A
Left outer join table B
on A.column1 = B.column1
and ((A.date1 between B.date1 and B.date2) or (A.date2 between B.date1 and B.date2))
First I used a Join and then used filter after that for date condition, but it gives me a wrong result.
Here both table A and B are files.
I under stood that left join and both date conditions should be done within Join.
Please let me know if there is way to get the correct result.