Re: calculating a median within a query



Thanks for your previous post. I've run into another hurdle, and would
greatly appreciate any help you may be able to offer. I have revenue
data sorted by month and years for a number of distinctly labeled
stores (imagine a Center ID). I would like to find the percentage of
"gainers" (stores whose monthly revenues exceed the previous month's
revenues) out of the all the stores. I know how to determine this by
using an individual queries to sort out each store's revenue by year
and month, and then use another query to classify gainers v. decliners,
and then (Fnally!) calculate the percentages. Is there an easier way to
do this than to run around 50 queries (one for each month for 4 years)?
Thanks.

Jonathan




CDMAPoster@xxxxxxxxxxxxxxxx wrote:
jonm4102 wrote:
I'm trying to calculate the median of some numerical data. The data can
only be found in a query (henceforth query 1) field I previously made,
and I would prefer to calculate the median in a new query it without
making a table out of query 1. I can't find a median function in the
"Total" field, so is there so way to make an expression to calculate
the median of the orignial data from query 1 in my new query?

Also, what does name by string mean?

Thanks.

I use SQL for finding medians. See:

http://groups.google.com/group/comp.databases.ms-access/msg/7fb6eb508f22fa9d

Click back a link or two to find SQL for the median of non-grouped
data.

I hope this helps,

James A. Fortune
CDMAPoster@xxxxxxxxxxxxxxxx

.



Relevant Pages

  • Re: calculating a median within a query
    ... using an individual queries to sort out each store's revenue by year ... and month, and then use another query to classify gainers v. decliners, ... I can't find a median function in the ... I use SQL for finding medians. ...
    (comp.databases.ms-access)
  • Re: Select Columns from Crosstab for Report - HELP PLEASE!!!
    ... If you only want to display one month, then why are you using a crosstab. ... Just set the criteria in the query to the month chosen by the user. ... Total Revenue and Revenue for current month. ... > FROM ((Totals INNER JOIN tblClients ON Totals.ClientName = ...
    (microsoft.public.access.reports)
  • Re: Question Regarding Combining Duplicate Records
    ... Rather - and I can't think why - you need a query that returns all the ... records but with "faked" values for Revenue: ... Unique ID Name Location Color Revenue ... I would identify duplicates throughh my duplicate query ...
    (microsoft.public.access.gettingstarted)
  • Re: Calculat Median for each data group?
    ... when I run the query I get the following error: ... And just to be clear - I'm looking for a different median rate to be ... Function MedianF(pTable As String, ... Dim sglHold As Single ...
    (microsoft.public.access.queries)
  • Re: using a "for" loop in a query to reference data from another t
    ... to figure out how to do....however, I like your suggestion. ... to do is ELIMINATE THE USER ENTRY portion of the query. ... > where your code implements the "20 days of revenue" feature. ... > Let's try to get just one portion of the UNION working correctly first. ...
    (microsoft.public.access.queries)