guru.com.pk
 
User Login

Username:
Password:
Register
Forgot Password?


Question: Filter on date column not working


 Category: Microsoft SQL Server 2005
 Asked By: guru
 Date: 5/7/2009 1:37:25 AM
 

i am joining two tables using left outer join as follows:

select t1.a, t2.b
from table1 t1
left outer join table2 t2
on t1.a + t1.b = t2.a + t2.b and t1.date >= '04/30/2009' and t1.date < '05/07/2009'

this query is not working. it takes long time but when finished it returns all rows ignoring date filter.


By: guru   On: 5/7/2009 2:52:58 AM

i have solved it my self.

following modifications worked.

select t1.a, t2.b
from table1 t1
left outer join table2 t2
on t1.a = t2.a and t1.b = t2.b
and t1.date >= '04/30/2009' and t1.date < '05/07/2009'

ACCEPTED ANSWER



Submit Your Answer