THE BOOK cover
The Unwritten Book is Finally Written!
An in-depth analysis of: The sacrifice bunt, batter/pitcher matchups, the intentional base on balls, optimizing a batting lineup, hot and cold streaks, clutch performance, platooning strategies, and much more.
Read Excerpts & Customer Reviews

Buy The Book from Amazon


SABR101 required reading if you enter this site. Check out the Sabermetric Wiki. And interesting baseball books.
MOST RECENT ARTICLES
MAIL : You ask | We say

Advanced


THE BOOK--Playing The Percentages In Baseball

<< Back to main

Thursday, May 20, 2010

How to calculate the Median value in MS Access


SELECT
    
(t2.medianT b2.medianB)/as medianValue
    
t2.medianT
    
b2.medianB
     
FROM
    
(
        
SELECT MIN(top50) AS medianT
        FROM 
(
            
SELECT TOP 50 PERCENT HR as top50 
            FROM Table1
            WHERE HR IS NOT NULL
            ORDER BY HR DESC
        
t
    
t2
    
,
    (
        
SELECT MAX(top50) AS medianB
        FROM 
(
            
SELECT TOP 50 PERCENT HR as top50 
            FROM Table1 
            WHERE HR IS NOT NULL
            ORDER BY HR ASC
        
b
    
b2
;

(8) Comments • 2010/05/22 • Web Admin
Page 1 of 1 pages

<< Back to main