Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Between not working

Author  Topic 

rammohan
Posting Yak Master

212 Posts

Posted - 2008-10-23 : 03:20:22
Hello ! Friends, I'm using between clause in below CTE . it's not giving data between start & end date , it gives data only on end date. please help
With member_list AS ( Select m.id,m.first_name,ml.parentid,m.join_type,m.payout_status,m.doj From member as m inner join mlm_member as ml on ml.id = m.id Where ml.parentid=1 and m.position='L' Union All Select m.id,m.first_name,ml.parentid,m.join_type,m.payout_status,m.doj From member as m inner join mlm_member as ml on ml.id = m.id Inner Join member_list As mli On ml.parentid = mli.id ) select id,first_name,parentid,join_type,doj from member_list where doj between '09/20/2008' and '10/01/2008' order by id option (maxrecursion 1000) Thanks..

One can never consent to creep,when one feels an impulse to soar
RAMMOHAN

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-23 : 03:45:18
you're using between only when selecting fron CTE. are you sure your CTE itself has sufficient records for all dates between passed values. try runing the initial CTE query alone and see if you get expected records returned.
Go to Top of Page
   

- Advertisement -