User Profile

Collapse

Profile Sidebar

Collapse
Francis Chiu
Francis Chiu
Last Activity: Apr 2 '12, 03:53 PM
Joined: Mar 30 '12
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • It does not work... I drafted the query below and a temporary table for time frame X to Y.

    Code:
    select
    c.clientname,
    round(avg(CONVERT(float,t.score)),5,0)
    from testscore t
    join client c
    on c.clientname=t.clientname
    where t.attemptdate >= X
    t.attemptdate < Y
    group by clientname

    #timeframe
    client name X Y
    A 2010-10-01 2012-11-01
    B ...
    ...
    See more | Go to post
    Last edited by PsychoCoder; Apr 1 '12, 05:38 PM. Reason: Code tags added

    Leave a comment:


  • How to Add Dependent Variable into Where Clause?

    I want to do some average score calculations based on 30 days from client enrollment date, and 60 and 90.

    Client's attempt to do a test is stored in testscore table like this:
    clientname eventid attemptdate score
    A 1001 2011-10-01 100
    B 1002 2011-10-02 100
    A 1003 2011-11-01 90
    C 1004 2011-11-08 100
    D 1005 2011-11-10 90
    B 1006 2011-11-13 80
    A 1007 2012-01-01 100...
    See more | Go to post
No activity results to display
Show More
Working...