select ma.UserName, ma.eventcd, ma.CompanyName, coalesce(ec.eventDescription, ma.eventcd) as eventDescription, ma.user_agent, '' as deviceType, '' as deviceOS, fsp.title, fsp.ownerid, fsp.fsl_tablecode, cast(ma.eventtime as date) eventdate, cast(month(ma.eventtime) as varchar) + '/' + cast(day(ma.eventtime) as varchar) as shortDate from tbl_TRK_MemberActivity ma with (nolock) left outer join tbl_trk_eventcodes ec with (nolock) on ec.eventcd = ma.eventcd and ec.siteContext like '%mobile-crm%' left outer join tbl_fspro_members fsp with (nolock) on fsp.fspro_userid = ma.fspro_userid where ma.Site = 'mobile-crm' and ma.IP_Address not like '192.168%' and ma.EventDetail not like '%demo%' and ma.EventDetail like '%demo%' and ma.EventCD <> 'LI' and ma.CompanyName <> '' and ( UPPER(eventdetail) like '%VARIANT:#ucase(url.appcode)#%' or ( UPPER(eventdetail) not like '%VARIANT:%' and UPPER(user_agent) like '%FSE:VARIANT=#ucase(_userAgentVariantString)#%' ) ) and ( ma.eventcd not in ('PRDS','ACTS','CONS','OPPS') or ma.eventdetail like '%"pg":"1"%' ) and DATEDIFF(d,ma.eventtime,getdate()) #iif(url.period lt 2,de('='),de('<='))#
> select eventdate, shortdate, count(distinct UserName) users from qryRawUserActivity where companyname = '#url.company#' group by eventdate, shortdate order by eventdate
select count(*) as ttl, username, companyname, title, eventdate from qryRawUserActivity where cast(eventdate as date) = group by username, companyname, title, eventdate order by ttl desc, username
  • Day checked> checked>     #numberformat(qryUserLeaderboard.recordcount,"9,999")# Users
    App checked> checked> checked>
  • #UserName#, #title#
    #CompanyName#
    #ttl# Transactions