Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2009
    Location
    Minnesota
    Posts
    2

    Question Unanswered: Creating Rank using 2 columns

    Hello, I am trying to determine the rate at which CSR's answer a customers questions with one call resolution (i.e. the customer doesn't have to call back). After each call the CSR is prompted to note the customer account - I've extracted a table from the in house database that contains the following column names:

    - CustomerID
    - CSR_ID
    - Date & Time
    - Note

    For one week I have 34,000 notes posted of which I have about 25,000 unique Customer ID's. From looking at the table I can see that some customers called 5-6 times (rare) but more frequently I see 2 or 3 calls total. I'm trying to create a query that would create a column that would tell me if the particular row was associated with the 1st, 2nd or 3rd time the customer had called by referencing the CustomerID and the Date & Time column.

    Any suggestions or help would be much appreciated.

    Thanks!

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Code:
    SELECT col1, (SELECT COUNT(*) FROM myT AS rank WHERE rank.CustomerID = myT.CustomerID AND rank.[Date & Time] <= myT.[Date & Time]) AS call_rank
    FROM myT
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Mar 2009
    Location
    Minnesota
    Posts
    2
    Awesome! Thanks for your help! That did the trick!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •