ADO / ASP / MEDIAN COMPUTATION

ADO / ASP / MEDIAN COMPUTATION

am 01.03.2005 13:56:59 von propedeutique

Hi,

I am looking for a way / an example to compute the median and
first/last quartils in ASP/ADO/SQL.

Thanks in advance for your answers.

Bi

Re: ADO / ASP / MEDIAN COMPUTATION

am 01.03.2005 14:22:26 von reb01501

spectre wrote:
> Hi,
>
> I am looking for a way / an example to compute the median and
> first/last quartils in ASP/ADO/SQL.
>
> Thanks in advance for your answers.
>
By "SQL" do you mean "SQL Server"? If so, what version?

Here's a google search with some relevant results:
http://www.google.com/search?sourceid=navclient&ie=UTF-8&rls =GGLC,GGLC:1969-53,GGLC:en&q=T%2DSQL+median

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: ADO / ASP / MEDIAN COMPUTATION

am 01.03.2005 18:29:44 von ten.xoc

Here's some treatment of MEDIAN:
http://www.aspfaq.com/2506

--
http://www.aspfaq.com/
(Reverse address to reply.)




"spectre" wrote in message
news:ecc6dac0.0503010456.541027b6@posting.google.com...
> Hi,
>
> I am looking for a way / an example to compute the median and
> first/last quartils in ASP/ADO/SQL.
>
> Thanks in advance for your answers.
>
> Bi

Re: ADO / ASP / MEDIAN COMPUTATION

am 01.03.2005 21:52:00 von propedeutique

Hi,
I mean sql server (as well as Ms Access as I use both type of databases)
Thanks



"Bob Barrows [MVP]" wrote in message news:...
> spectre wrote:
> > Hi,
> >
> > I am looking for a way / an example to compute the median and
> > first/last quartils in ASP/ADO/SQL.
> >
> > Thanks in advance for your answers.
> >
> By "SQL" do you mean "SQL Server"? If so, what version?
>
> Here's a google search with some relevant results:
> http://www.google.com/search?sourceid=navclient&ie=UTF-8&rls =GGLC,GGLC:1969-53,GGLC:en&q=T%2DSQL+median
>
> Bob Barrows

Re: ADO / ASP / MEDIAN COMPUTATION

am 02.03.2005 10:54:41 von propedeutique

Thanks for your help... any idea about quartil computation?

Bi



"Aaron [SQL Server MVP]" wrote in message news:<#8upDRoHFHA.3928@TK2MSFTNGP09.phx.gbl>...
> Here's some treatment of MEDIAN:
> http://www.aspfaq.com/2506
>
> --
> http://www.aspfaq.com/
> (Reverse address to reply.)
>
>
>
>
> "spectre" wrote in message
> news:ecc6dac0.0503010456.541027b6@posting.google.com...
> > Hi,
> >
> > I am looking for a way / an example to compute the median and
> > first/last quartils in ASP/ADO/SQL.
> >
> > Thanks in advance for your answers.
> >
> > Bi

Re: ADO / ASP / MEDIAN COMPUTATION

am 02.03.2005 15:33:22 von ten.xoc

> Thanks for your help... any idea about quartil computation?

Need more information, since there are many variables. If you have 39 rows,
which quartile comes up one row short? If there are ties, what happens?

If you provide DDL, sample data, and desired results, you might get more
specific help.

http://www.aspfaq.com/5006

Re: ADO / ASP / MEDIAN COMPUTATION

am 03.03.2005 18:11:14 von propedeutique

Thanks for your answer,

I have curently an application under access/vba with the following
code for median/quartil which works perfectly.

As you can see, the "quartil" (or, here percentile) can be defined
according to the user needs.

Being an "amateur", I am not sure enough to "translate" it in asp.

Thanks again.

Bi


The code is as followed, in vba:




Public Function XPercentile(FName As String, _
TName As String, _
x As Single) _
As Single
' FName = Field name
' TName = Table name
' x = decimal percentile (0.68 for 68%)
Dim intPercent As Integer
Dim strPartieEntiere As String
Dim strPartieDecimal As String
Dim dbValeur As Long

' Return the minimum value for which x% of
' the values are lower or equal to it

'If 1median table is empty, end function

If DCount("*", TName) = 0 Then
'MsgBox "No benchmark data available", vbInformation, "No
Data"
Exit Function
End If

dbValeur = x * DCount("*", TName)

intPercent = dbValeur
strPartieEntiere = CStr(intPercent)
intPercent = (dbValeur - intPercent) * 100
strPartieDecimal = CStr(intPercent)

XPercentile = DMin( _
FName, _
TName, _
"DCount(""*"", """ & TName & """, """ & FName & _
"<="" & [" & FName & " ]) >= " & _
strPartieEntiere & _
"." & _
strPartieDecimal & " " _
)
End Function







"Aaron [SQL Server MVP]" wrote in message news:<#NG7KTzHFHA.2620@tk2msftngp13.phx.gbl>...
> > Thanks for your help... any idea about quartil computation?
>
> Need more information, since there are many variables. If you have 39 rows,
> which quartile comes up one row short? If there are ties, what happens?
>
> If you provide DDL, sample data, and desired results, you might get more
> specific help.
>
> http://www.aspfaq.com/5006