Syntax Qn

Results 1 to 2 of 2

Thread: Syntax Qn

  1. #1
    Join Date
    Dec 1969

    Default Syntax Qn

    Hi All,<BR><BR>I have a stored proc as below:<BR><BR><BR>/****** Object: Stored Procedure dbo.sp_Claims_Summary Script Date: 04/11/2002 1:21:54 PM ******/<BR><BR><BR>CREATE PROCEDURE dbo.sp_Claims_Summary<BR>AS<BR>BEGIN TRANSACTION<BR><BR>if exists (select * from sysobjects where id = object_id(N&#039;[dbo].[temp_Claim_Summary]&#039;) and OBJECTPROPERTY(id, N&#039;IsUserTable&#039;) = 1)<BR> drop table [dbo].[temp_Claim_Summary]<BR><BR>SELECT DISTINCT <BR> field1, ......, <BR> (SELECT SUM(Old_Amount) <BR> FROM dbo.Status_Report_TP<BR> WHERE t_801_employee.UserID = dbo.Status_Report_TP.Claimant_ID AND Claim_No IS NOT NULL)<BR>AS TP_OldAmount <BR><BR>INTO temp_Claim_Summary<BR>FROM dbo.t_801_employee <BR><BR>where dbo.t_801_employee.userid in (subquery)<BR>COMMIT TRANSACTION<BR>GO<BR><BR>Currently, some of the TP_OldAmount vals are null, how do i assign it 0 instead ?<BR><BR><BR>TIA,<BR>Mansi

  2. #2
    Join Date
    Dec 1969

    Default RE: Syntax Qn

    coalesce(TP_OldAmount , 0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts