Skip to main content

Notifications

Microsoft Dynamics RMS (Archived)

Total Visits Report

Posted on by Microsoft Employee

Mabuhay!

Is there any chance that I can filter Total Visits field in RMS 2.0? For example, I have a customer a who register last month. On the next day He purchase so it counts on visit as 1. Daily He uses to visit the store and purchase items. After the end of the month when we check for his total visits it will post 30 visits because he purchase for the whole month. 

My query for this report is I want to know his total visit just for the 15 days onwards, or filtering it via date, is it possible?

Thank you,
Chris

 

 

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Total Visits Report

    Don't forget to change the dates

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Total Visits Report

    The first query will show the results by store, so the number of visits is per store and any customer might appear more than once

    The second query doesn't show the store, so the number of visits is per the whole company

    select store.name,accountnumber,company,count(*) as Visits,sum(total)

    from [transaction]

    inner join customer on customer.id=customerid

    inner join store on [transaction].storeid=store.id

    where time >='2012-01-01'

    and time < '2012-09-01'

    group by store.name,accountnumber,company

    order by 4 desc

    select accountnumber,company,count(*) as Visits,sum(total)

    from [transaction]

    inner join customer on customer.id=customerid

    where time >='2012-01-01'

    and time < '2012-09-01'

    group by accountnumber,company

    order by 3 desc

    A Hassan

    RMS Leaders

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Total Visits Report

    Mabuhay Sir Hassan!

    buying like i consider transaction.

    1. account number, storeid, sales, company name

    2. by date transaction

    3. by times of total visit (excluding waht is not filtered by date)

    Thank you,

    Chris

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Total Visits Report

    What do u mean by "by buying"?

    Please explain what u need as below: -

    1- columns to retrieve

    2- filters to be used

    3- sorting order

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Total Visits Report

    Mabuhay Sir Hassan,

    Thank you Sir so much, Id like to look for how many time they visit the stores by buying wiht my filter dates.

    Id like to know who among the top visitors who visits our store for July - Aug 2012.  Withouth including their previous visit before July 2012.

    Thank you,

    Chris

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Total Visits Report

    tell me what u wanna get and I will post the query for u

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Total Visits Report

    SELECT COUNT(*) AS Expr1,

    Customer.AccountNumber,

    Customer.TotalVisits,

    Customer.EmailAddress,

    [Transaction].TransactionNumber,

    [Transaction].StoreID

    FROM [Transaction]

    INNER JOIN Store ON Store.ID = [Transaction].StoreID

    INNER JOIN Customer ON Customer.ID = [Transaction].CustomerID AND Customer.StoreID = [Transaction].StoreID

    WHERE [Transaction].[Time] between CONVERT(DATETIME, '2008-01-01') AND CONVERT(DATETIME, '2008-12-31') AND

    Customer.AccountNumber <> ''

    GROUP BY Customer.AccountNumber,

    Customer.TotalVisits,

    Customer.EmailAddress,

    [Transaction].TransactionNumber,

    [Transaction].StoreID

    ORDER BY Customer.AccountNumber

    is it counting the total visit by the query of the filtered date?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Total Visits Report

    Mabuhay Sir Hassan,

    Yes Sir, we are using SQL 2000.  Im running the query on console root. I noticed it always "timeout expired" and if I run it on SQL Analyzer it will show the result.

    Thank you very much sir :)

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Total Visits Report

    Strange enough!

    u r using SQL 2000, right?

    r u using the query with store or HQ database?

    A Hassan

    RMS Leaders

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Total Visits Report

    Mabuhay Sir Hasan,

    Thank you very much for the quick response. Script is running on our Store Operation database but if I will try that code for the query in Enterprise Manager  it always timeoutexpired? Or my resources needs a lot more memory or my query needs it?

    By the way, Im sorry the script is running on tables query field is that the reason i lost my resources. And if i tried it on sql query analyzer it runs and it will produce the report? 

    Thank you,
    Chris

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans