Thanks, Kyle. I'll read the date documentation, but on first run I'm getting an error from the 'functions' method...
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 8 SQL=SELECT COUNT( DISTINCT u.id ) FROM jos_users u JOIN jos_user_usergroup_map g ON g.`user_id` = u.`id` JOIN jos_comprofiler ue ON ue.`id` = u.`id` WHERE u.block = 0 AND ue.approved = 1 AND ue.confirmed = 1 AND ue.banned = 0 AND g.group_id IN (2) AND ( ue.`cb_usertype` = 'Looking for Ride' AND ( ( ( u.`registerDate` >= DATE_SUB( NOW(), INTERVAL 5 DAY ) ) AND ( ( ue.`cb_departuredate` = '' ) OR ( ue.`cb_departuredate` IS NULL ) ) ) OR ( ( ue.`cb_departuredate` >= NOW() ) OR ( ( ue.`cb_departuredate` <= NOW() ) AND ( ue.`cb_todate` >= NOW() ) ) )
I tried INTERVAL both ways you suggested also, Heyai, but still getting the same result. I don't think I mentioned the result I was getting from my method... basically, it acts like there's no filter (except the first condition is working: usertype is 'looking for ride').
Like I said, I'll read through the SQL date documentation via the link you gave me. If it still doesn't work and I don't find an answer here, I guess I have a few other options like finding a Joomla plugin to unpublish users after 5 days of inactivity (not the perfect solution). Or maybe adding an extra 'unpublish after' field to the profile.