Maneesh A N

Maneesh A N

  • NA
  • 179
  • 109.1k

select sp

Apr 22 2015 4:08 AM

CREATE procedure GoldStar_BalanceMakingCharge_Select
    AS
    declare @value1 int,@value2 int

    SELECT  GoldStar_ClientMaster.ClientID, GoldStar_ClientMaster.Name, GoldStar_DayBook.IsVaravu,
    (select isnull(SUM(GoldStar_DayBook.MakingCharge),0) AS SumMakingChargeV, GoldStar_DayBook.IsVaravu
FROM         GoldStar_ClientMaster INNER JOIN
 GoldStar_DayBook ON GoldStar_ClientMaster.ClientID = GoldStar_DayBook.ClientID
Where      GoldStar_DayBook.IsVaravu = 1
GROUP BY GoldStar_ClientMaster.ClientID, GoldStar_ClientMaster.Name, GoldStar_DayBook.IsVaravu
)-(select ISNULL(SUM(GoldStar_DayBook.MakingCharge),0) AS SumMakingChargeC, GoldStar_DayBook.IsChelavu
FROM         GoldStar_ClientMaster INNER JOIN
 GoldStar_DayBook ON GoldStar_ClientMaster.ClientID = GoldStar_DayBook.ClientID
Where      GoldStar_DayBook.IsChelavu = 1
    GROUP BY GoldStar_ClientMaster.ClientID, GoldStar_ClientMaster.Name, GoldStar_DayBook.IsChelavu
)
 
please correct this SP 


Answers (2)