Hi,
I want to get count of Job status like count of open,count of closed jobs and count of processing jobs
This is my procedure :
USE [SmartJob
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROC [dbo].[GetJobStatus]
@CompanyID INT
AS
BEGIN
SELECT [StatusID]
,M.Value 'Status' FROM Jobs J
JOIN Master M ON M.MasterID=J.StatusID
WHERE CompanyID=@CompanyID;
END

Please help me
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.


K P Singh ChundawatRank #1,527 · 1K reputationPosted Mar 7, 2016, 9:06 PM EST
Devendra KumarRank #3,132 · 457 reputationPosted Mar 7, 2016, 9:26 PM EST
Ranjit PowarRank #553 · 4.4K reputationPosted Mar 7, 2016, 9:02 PM EST
Chandu KumawatRank #1,449 · 1.1K reputationPosted Mar 7, 2016, 9:04 PM EST
CREATE TABLE #temp ( ID INT, NAME VARCHAR(100), ... ) INSERT INTO #temp Exec dbo.MyStoredProc SELECT COUNT(*) FROM #temp SELECT ID, NAME FROM #temp WHERE ID = 10 DROP TABLE #temp