Query

  • Hi

    I have a one query

    select E.FullName,E.DepartmentID,S.NoOfWorkingDays,F.Percentage,S.CalculatedAmount

    from Employee E left join T5052_P009 S on E.EmployeeID=S.EmployeeID left join T5052_C010 F on

    E.EmployeeID=F.EmployeeID WHERE (E.CompanyID = 1) AND ( E.EmployeeId in ( 145, 190, 203, 204, 239, 258, 259, 261, 262, 306, 308, 309, 416, 417 )) group by E.DepartmentID,E.FullName,S.NoOfWorkingDays,F.Percentage,S.CalculatedAmount

    execute this query below output wil show

    Ben Miller29NULLNULLNULL

    David Bradley29NULLNULLNULL

    Eric Hagins29NULLNULLNULL

    Eric Kurjan29NULLNULLNULL

    Frank Pellow29NULLNULLNULL

    Fukiko Ogisu29NULLNULLNULL

    Gail Erickson29NULLNULLNULL

    Gordon Hee29NULLNULLNULL

    Jae Pak29NULLNULLNULL

    Jian Shuo Wang29NULLNULLNULL

    John Wood29NULLNULLNULL

    Jossef Goldberg29NULLNULLNULL

    dasda dadasda31NULLNULLNULL

    qeqeq eqweqe45NULLNULLNULL

    but i want

    DepID = 29

    Ben Miller29NULLNULLNULL

    David Bradley29NULLNULLNULL

    Eric Hagins29NULLNULLNULL

    Eric Kurjan29NULLNULLNULL

    Frank Pellow29NULLNULLNULL

    Fukiko Ogisu29NULLNULLNULL

    Gail Erickson29NULLNULLNULL

    Gordon Hee29NULLNULLNULL

    Jae Pak29NULLNULLNULL

    Jian Shuo Wang29NULLNULLNULL

    John Wood29NULLNULLNULL

    Jossef Goldberg29NULLNULLNULL

    depID =31

    dasda dadasda31NULLNULLNULL

    depID =45

    qeqeq eqweqe45NULLNULLNULL

    please help me

    Regards

    S.Senthilnathan

  • Why you want it that way ..?. If you want it for reporting purpose, you can do it in front end application.

  • If this is for a report, then I would suggest returning the DepID as part of the result set. You can then just add the DepID as the group header.

    BJC

  • hi

    iam using report viewer give me sample

  • hi

    Any sample for reportviewer

  • The following is good article on reporting services. If you look at the screen shot of the report wizard, all you would have to do is add the dep id that you referenced in the "group>" and then add the rest of the records to the detail. If this is not clear, please let me know.

    http://www.sqlservercentral.com/articles/Development/designingyourfirstreportinreportingservices/1416/

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply