web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Get The Users whose are currently working on Cases

(0) ShareShare
ReportReport
Posted on by 958

Scenario is First, I want to show the status of cases in SQL Server. In Status field there is no value to show the case is open i guess.

So how could i get that how many cases are open and their user name?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Rawish Kumar Profile Picture
    13,758 on at

    Hi Shakti,

    Would you mind explaining bit more on " In Status field there is no value to show the case is open i guess.".

    However if i understood your second line correctly - all you need is below :

    Select OwnerIdName, count(incidentid) as CountOFCases from incident
    where statecode = 0
    group by OwnerIdName

  • Shakti Singh Rajput Profile Picture
    958 on at

    Thanks for response Rawish,

    I want to display that which cases are open state and close state.

    Like,  I had a custom field "Case_Status" which is blank initially. When I am open a case record within the list of case records then the value of "Case_Status" field is assigned to 'Opened' and if the case is closed(Resolved) then update the field value to Closed.

    How could i get the same?

  • Suggested answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi  Shakti Singh Rajput,

    Use advanced find view. I think this will solve your problem. Feel free to ask more.

    Thanks

    Regards,

    AW

  • Suggested answer
    Rawish Kumar Profile Picture
    13,758 on at

    To get the label names in sql query you might have to perform a join operation on a stringmap table.

    However i would recommend you to use simple like below.

    1. open the attribute "Case_Status" from customiziation and see what value(integer) represent open and what  represents a close case:

    then simply run the below query:

    Select Case_Status, count(Case_Status) as CountOFCases from incident

    group by Case_Status

    make sure the field name is correct.

  • Shakti Singh Rajput Profile Picture
    958 on at

    Could you please elaborate?

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi Shakti,

    You have tagged your question as CRM Online. If it is correct and you are on CRM Online then you can't access SQL. If you are on premise, you can follow above suggestions.

    Hope this helps.

  • RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi Shakti,

    How did you get on with this? If you have got your answer, please close the thread by mark the suggestion as answer if it helped you

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
RichardM Profile Picture

RichardM 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans