I would like to run the following query.
It will sum all dates that are between 4 and 9 days old
This is what I have so far
Select Sum(if((TO_DAYS(NOW()) - TO_DAYS(Date_Entered))(>4 and <9),1,0)) As 4to9 from table Group By Whatever
The problem is with the (>4 and <9) part, because if I just put >4 the query will work correctly.
Thanking in advance for any help received
It will sum all dates that are between 4 and 9 days old
This is what I have so far
Select Sum(if((TO_DAYS(NOW()) - TO_DAYS(Date_Entered))(>4 and <9),1,0)) As 4to9 from table Group By Whatever
The problem is with the (>4 and <9) part, because if I just put >4 the query will work correctly.
Thanking in advance for any help received