Forum Replies Created

Viewing 12 posts - 1 through 12 (of 12 total)

  • RE: Monthly Trend Calculation

    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...

  • RE: Monthly Trend Calculation

    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...

  • RE: Monthly Trend Calculation

    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...

  • RE: Monthly Trend Calculation

    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%'...

  • RE: Monthly Trend Calculation

    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...

  • RE: Monthly Trend Calculation

    thanks Guys for all your help, I very much appreciate it. Have a wonderful weekend & God Bless you all!

  • RE: Monthly Trend Calculation

    Hi,

    One more question please, is there a way to combine Month Year in one column/row ?

    YrMnth ...

  • RE: Monthly Trend Calculation

    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...

  • RE: Monthly Trend Calculation

    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)...

  • RE: Cannot Perform an Aggregate function on an expression containing an aggregate or a subquery

    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....

  • RE: Count How Many Users are Logged IN Per Day

    deleting topic...

  • RE: Count How Many Users are Logged IN Per Day

    deleting topic...

Viewing 12 posts - 1 through 12 (of 12 total)