Viewing 12 posts - 1 through 12 (of 12 total)
Hi Thomas,
after the CTE's I tried the below query and it seems to be working...
Select cu.Hub, cu.Concurrent_Date, Entitled_Users, cu.Peak_Concurrent_Users, (Select SUM(t2.Entitled_Users) as Entitled_Users
from Cnt T2
where T2.When_Added_To_Group <=t1.When_Added_To_Group) as Entitlement_Running_Total
from...
December 15, 2015 at 8:34 pm
MS SQL version is 2012 SP1....Below are some of the errors I encountered...
Incorrect Syntax near the keyword Select...
Incorrect Syntax near ','
I tried the below query and i got the error
Incorrect...
December 14, 2015 at 8:04 pm
Hi Thomas,
I think my syntax/logic in not correct that is why it's confusing...Apologies as I am not that expert on CTE's so hoping for your kind help...
The query below is...
December 14, 2015 at 7:48 pm
I tried below combining it into three CTE but still no luck 🙁
WITH Cnt AS (
select Count(Distinct UserID) as Entitled_Users, DATEFROMPARTS(YEAR(t.WhenAddedToGroup),MONTH(t.WhenAddedToGroup),1) as When_Added_To_Group
from HVDMembership t
where FirstName not like '%test%'...
December 14, 2015 at 6:05 am
Hi,
Seeking your help/guidance again please as my SQL skill is not that advance...I trying to combine or join the two SQL query below (I guess the first one is called...
December 13, 2015 at 9:58 pm
thanks Guys for all your help, I very much appreciate it. Have a wonderful weekend & God Bless you all!
December 12, 2015 at 12:23 am
Hi,
One more question please, is there a way to combine Month Year in one column/row ?
YrMnth ...
December 11, 2015 at 8:05 pm
Hi Thomas,
I found out the reason why the total is 525 using the count distinct of SQL, it is because there are USERID's that are a member of multiple security...
December 11, 2015 at 7:38 pm
Hi,
thanks for your quick reply, when I tried the query on my actual table there discrepancy on the Running Total....for example I queried the Total distinct UserID by Count(Distinct UserID)...
December 10, 2015 at 11:35 pm
Hi John,
Thanks for your reply, I tried your suggestion but I still get the same error "Cannot Perform an aggregate function on an expression containing an aggregate or a subquery....
November 30, 2015 at 8:14 pm
Viewing 12 posts - 1 through 12 (of 12 total)