ok,
i think about something and i wish this can help.
vb Code:
SELECT COUNT(Custstatus),dbo.TotalCount() as TotalRows FROM <TableName>
GROUP By Custstatus
where dbo.TotalCount() is Scalar Valued Function
and here is its Definision
vb Code:
USE [<your Database>]
GO
/****** Object: UserDefinedFunction [dbo].[TotalCount] Script Date: 08/24/2009 10:47:02 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE Function [dbo].[TotalCount]()
RETURNS int
AS
BEGIN
DECLARE @Return int
SET @Return = (SELECT COUNT(*) FROM dbo.<yourTableName>)
return @Return
END