MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: <Author,,Name> -- Create date: <Create Date,,> -- Description: <Description,,> --exec [dbo].[spr_PhoneFix90days] -- ============================================= ALTER PROCEDURE [dbo].[spr_PhoneFix90days] -- Add the parameters for the stored procedure here AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET ROWCOUNT 0 SET NOCOUNT ON; DECLARE @Count int, @PhoneCount int, @PhonePercent decimal(10,1) SELECT @Count = (SELECT COUNT( *) FROM root_SERV_CALL) SELECT @PhoneCount = (SELECT COUNT( *) FROM root_SERV_CALL WHERE SYMPTOM_CODE = 'PHONE') SET @PhonePercent = cast(@PhoneCount as decimal(10,1))/ cast(@Count as decimal(10,1)) * 100 --SET @PhonePercent = (@PhoneCount/@Count)*100 --SET @PhonePercent = ((@Count * 100)/@PhoneCount) --SET @PhonePercent = @PhoneCount / @Count) --SET @PhonePercent = (@PhoneCount / @Count) * 100 --PRINT @Phonecount -- Insert statements for procedure here SELECT MODEL, SERIAL, CALL_DATE_SCA, REPRESENTATIVE, CALL_ID, CALL_TYPE, SYMPTOM_CODE, PRODUCT, @PhonePercent AS PhonePercent, @PhoneCount AS PhoneCount, @Count AS RCount FROM root_SERV_CALL WHERE (SYMPTOM_CODE = N'PHONE') AND (CALL_DATE_SCA > DATEADD(day, - 90, GETDATE())) --(SYMPTOM_CODE = N'PHONE') AND END
|SQL Server: Unable to remove duplicate sets in Header/Detail||6||34|
|Need help constructing a conditional update query||16||77|
|Microsoft Access Delete all Records from table but Max||2||27|
|SQL Select Query help||1||34|