none
ABC12

    Question

  • select chsuerid, count(*) from issues inner join actions on actions.issueid = issues.issueid where chsuserid = '4042' and refrenceid like '11%' and [Status] = '4' and not exists (select 1 from Actions A where A.chsUerID = Actions.chuerID and A.Status = '5') Group by chsuserid

    Status for closed ='4' and reopened it is ='5'

    My question Number is of complaints closed by the employee & not reopened

    how write exact query please help soon

    Thursday, August 02, 2012 5:52 AM

Answers

  • Star12345, you have posted this question many times over the past day and have not responded with information that allows people to assist you.  Please either reply with valid information or stop posting this question.

    Thanks,
    Sam Lester (MSFT)

     

    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click "Mark as Answer" and "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread.

    Thursday, August 02, 2012 3:12 PM

All replies

  • Try the below:

    select chsuerid, count(*)from issues inner join actions on actions.issueid = issues.issueid where chsuserid ='4042'and refrenceid like'11%' and [Status]='4' and not exists(select 1 from Actions A where A.chsUerID = Actions.chuerID and A.Issueid=actions.issueid and A.Status ='5')Group by chsuserid


    Please click the Mark as Answer or Vote As Helpful button if a post solves your problem or is helpful!

    Thursday, August 02, 2012 6:08 AM
  • Sir getting but still giving but i will try. 

    I think we get solution easily thinking like

    Number of complaints closed by employee and reopened.... but
    finally closed by another employee  

    sir can u plz reply soon 

    • Edited by star12345 Thursday, August 02, 2012 6:47 AM fd
    Thursday, August 02, 2012 6:15 AM
  • Star12345, you have posted this question many times over the past day and have not responded with information that allows people to assist you.  Please either reply with valid information or stop posting this question.

    Thanks,
    Sam Lester (MSFT)

     

    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click "Mark as Answer" and "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread.

    Thursday, August 02, 2012 3:12 PM
  • I hited this query :

    select chsuerid, count(*) from issues inner join actions on actions.issueid
      = issues.issueid where chsuserid = '4042' and refrenceid like '11%' and [Status] = '4' and not exists (select from 
     Actions A where A.chsUerID = Actions.chuerID and A.Status = '5')
     Group by chsuserid 

    my question is 

    Number of complaints closed by employee and reopened.... but
    finally closed by another employee

    Status for reopened is = 5 and for closed it is 4

    how hit the query

    Friday, August 03, 2012 5:15 AM
  • select chsuerid, count(*) from issues inner join actions on actions.issueid
      = issues.issueid where chsuserid = '4042' and refrenceid like '11%' and [Status] = '4' and not exists (select from 
     Actions A where A.chsUerID = Actions.chuerID and A.Status = '5')
     Group by chsuserid 

    What not exits???

    Friday, August 03, 2012 8:49 AM
  • Hi,

    Please post your DDL along with some sample data + the expected output please. It may help us to provide much better help than guessing.

    thanks,

    Janos


    There are 10 type of people. Those who understand binary and those who do not.

    My Blog | Hire Me

    Friday, August 03, 2012 9:27 AM