sql server - How can i use the sum of sums in a having clause in SQL -


This is my SQL code, problem is in the HAVING section, I have tried to use On the alias name, it will not work that someone told me that there is no facility to use the alias name in the HAVING section or WHERE section in SQL Server, so I Tried to use this one but it is not working, either

Please I need your help.

Here is my SQL code:

  SELECT LEFT (RSTab1.EventstartDate, 6) MONTHtab1, LEFT (RSTab2) Investment Date, 6) Mantat 2, RSTAB2, TIGMNumber (Subscriberbase). [DBO]. [CDRsbbbb@redge.org] With AS RSTAB1 (NOLKACK) ININ JOIN (SRTAB 2) Revenue RWF + SUM (RSTAB 1. Revenue) Total number of subscriptions from DRHUX1. RSTab1.Tig with DWHAUX1.CCDRNOrmal.dbo.nrmMSC RSTab2 (NOLOCK) OMainNumber = RSTab2.CalledPartyNumber where between 201310 and 201403 or left (RSTab2.EventstartDate, 6) between 201310 and 201403 and SUM (SUM (RSTAB 2.RevenueRWF) + SUM (RSTAB1 Revenue) between left (RSTab1.EventstartDate, 6) 6) Group by Left (RSTAB, Ententement Date, 6), Left (RSTAB 2. Avenantstant, 6), RSTAB 1. Tigo Mannambar Having SM (SM (RSTAB 2. RevenueRWF) + SM (RSTAB 1. Revenue )); COUNT (*) DES with order of 680 (SEST LEFT (RSTab1.EventstartDate, 6) from