CRM-13738 related fix

Improvised Activity Report query buildup and resolved issue mentioned in the jira ticket itself.