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
- 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
the query would be:
Select everything from
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