Re: If statement in a where query....

2004-12-01 Thread yoge
Check whether below query helps u ? Select * from db where IFNULL(last_renewal_date,signup_date) between '2004-11-01' and '2004-11-30' Regards --Yoge Mike Morton wrote: I am trying to find a list of people based on renewal dates, the logic of the query would be: Select everything from the db wher

Re: If statement in a where query....

2004-12-01 Thread Rhino
- Original Message - From: "Mike Morton" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, December 01, 2004 2:47 PM Subject: If statement in a where query > I am trying to find a list of people based on renewal dates, the logic of > th

Re: If statement in a where query....

2004-12-01 Thread SGreen
You don't need an IF only parentheses. This is almost a literal translation of your exact statement Select * from db where (last_renewal_date between '2004-11-01' and '2004-11-30') or (last_renweal_date is null AND signup_date between '2004-11-01' and '2004-11-30' ) order by last_

If statement in a where query....

2004-12-01 Thread Mike Morton
I am trying to find a list of people based on renewal dates, the logic of the query would be: Select everything from the db where the last renewal date is between a and b, or if there is no last renewal date then where the signup date is between a and b The query that I have is something like: S