Page 3 of 3 FirstFirst 123
Results 31 to 36 of 36
  1. #31
    gcgoode is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Aug 2015
    Posts
    31
    Quote Originally Posted by June7 View Post
    Ooops, forgot that and I had already downloaded the file and reviewed. Will do some more.

    First thing I did was test the function by calling from the VBA immediate window:

    ?DMedian("Age","Driver")

    That returns 41.

    So the function basically works.
    Ok, thanks.



    Yeah the only thing I've gotten to work is when I simplify the hell out of it I can usually get it to find the median of all TotalPremiums.

  2. #32
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Did lot more edits on that post. Review again.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #33
    gcgoode is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Aug 2015
    Posts
    31
    Quote Originally Posted by June7 View Post
    Did lot more edits on that post. Review again.
    Yeah, just saw it. The Polrate thing was smart. Ill keep trying to get this last query to work. Really starting to wonder if all that Im wanting to do is even possible in Access.

  4. #34
    gcgoode is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Aug 2015
    Posts
    31
    Quote Originally Posted by June7 View Post
    Did lot more edits on that post. Review again.
    I know you're probably sick of looking at this, but I have one more quick question to ask you: Is it possible to add additional criteria to this median query? Right now the output is really close to what I want. It returns the fields Median, Age, Sex, and Marital status. But the Medians its calculating is only based on age. So in the output a 35 year old married female will have the same median as a 35 year old single male. I assume thats because in my code:

    Code:
    SELECT DMedian("PolRate","Query5","Age=" & [Age]) AS MedRate, Query5.Marital, Query5.Age, Query5.Sex
    FROM Query5
    GROUP BY Query5.Marital, Query5.Age, Query5.Sex;

    The only criteria is age. I try to add more but my function Dmedian only calls for three arguments. And I haven't found a way to add more to that module without getting an error. Any ideas?

  5. #35
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    DMedian("PolRate","Query5","Age=" & [Age] & " AND Sex='" & [Sex] & "'")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #36
    gcgoode is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Aug 2015
    Posts
    31
    At long last, my query works. I can't thank you enough for all the help.

Page 3 of 3 FirstFirst 123
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Complicated Query
    By RozS in forum Access
    Replies: 5
    Last Post: 01-28-2014, 02:49 PM
  2. MOST COMPLICATED query ever
    By dastr in forum Queries
    Replies: 1
    Last Post: 07-05-2012, 04:29 AM
  3. Query with Complicated Requirements
    By Briana in forum Queries
    Replies: 1
    Last Post: 06-13-2012, 08:05 PM
  4. Finding the Median when in a grouped Query
    By jamesborne in forum Queries
    Replies: 4
    Last Post: 02-22-2012, 08:24 PM
  5. Finding Median in Query
    By randolphoralph in forum Queries
    Replies: 1
    Last Post: 02-19-2010, 11:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums