Hi Kyle,
Thanks for the additional info, but it does not work, I get no listings when using:
( ( SELECT COUNT(*) FROM `#__cbsubs_subscriptions` AS sub WHERE sub.`user_id` = u.`id` AND sub.`status` = 'X' ) >= 1 )
AND ue.`cb_branch_code` = 'NSW'
I do get listings (via the CB backend) when searching for "Expired" listings with "NSW" in the cb_branch_code field.
I also tried:
( ( SELECT COUNT(*) FROM `#__cbsubs_subscriptions` AS sub WHERE sub.`user_id` = u.`id` AND sub.`status` = 'X' ) >= 1 AND ue.`cb_branch_code` = 'NSW'
)
That did not work either, so I also tried:
( ( SELECT COUNT(*) FROM `#__cbsubs_subscriptions` AS sub WHERE sub.`user_id` = u.`id` AND sub.`status` = 'X' ) >= 1 ) AND
u.`cb_branch_code` = 'NSW'
That gave this error:
Unknown column 'u.cb_branch_code' in 'where clause' SQL=SELECT COUNT( DISTINCT u.id ) FROM #__users u JOIN #__user_usergroup_map g ON g.`user_id` = u.`id` JOIN #__comprofiler ue ON ue.`id` = u.`id` WHERE u.block = 0 AND ue.banned = 0 AND ue.approved = 1 AND ue.confirmed = 1 AND g.group_id IN (18,
AND ( ( ( SELECT COUNT(*) FROM `#__cbsubs_subscriptions` AS sub WHERE sub.`user_id` = u.`id` AND sub.`status` = 'X' ) >= 1 ) AND u.`cb_branch_code` = 'NSW' )
Can you please let me know what else I should try?
Thanks,
Dion.