CREATE PROCEDURE [dbo].[UserWorkDetails] AS BEGIN select a1.projectName,COUNT(distinct s.SrNo)as total_count from ADDPROJECTNAMETOCRMSYSTEM a1 inner join savetodb as s on a1.projectid=s.Projectid inner join AssignprojectToMemberwithDetailInstruction as a2 on a2.Projectid=s.Projectid where a2.MemberId=3 and a2.RowFNoTo<>'' and a2.RowFNorom<> '' and s.SrNo between a2.RowFNorom and a2.RowFNoTo group by a1.projectName select COUNT(distinct SrNo)as Work_count from savetodb where MemberId=3 and FirstName<>'NA' and FirstName<>'' group by Projectid End |