Results 1 to 3 of 3
  1. #1
    neo651 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    110

    Query Displaying Standard Deviations

    Alright, so because I'm a little OCD and an insufferable penny pincher I have a database for tracking groceries and such. To keep this short, each entry has a Grocery Type and a Grocery subtype. I want to create a query that displays, for every combination of grocery type and subtype, the standard deviation of all prices paid per unit. So, for example, in the query grocery type: beef, subtype: Ground would display the standard deviation of $/lb for all the entries where I have prices for that.

    If it's unclear let me know...I'm having trouble describing it myself.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by neo651 View Post

    If it's unclear let me know...I'm having trouble describing it myself.
    I think you have done a good job. The way I understand it, you are a penny pinching miser who likes beef but will purchase ground beef because it is cheapest. I can relate to that.

    So, what is the question? Do you have anything started with your DB yet?

  3. #3
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    I don't see a standard deviation aggregate function here http://www.techonthenet.com/access/functions/. Too bad, that would have made it simple.

    However, I do see a DStDev function here http://msdn.microsoft.com/en-us/libr...ffice.11).aspx

    That's about the same thing, with a slightly different syntax. Here's a very rough aircode example -
    Code:
    SELECT
       MyQuery.MyType,
       MyQuery.MySubType,
       Avg(MyQuery.UnitPrice) As MyAvgPrice,
       DStDev("[UnitPrice]", "[MyQuery]","[MyType] = " & MyQuery.MyType & " AND [MySubType] = " & MyQuery.MySubType) As MyStDev 
    FROM MyQuery
    GROUP BY 
       MyQuery.MyType,
       MyQuery.MySubType;

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Formating date to Australian standard.
    By hanbob in forum Reports
    Replies: 1
    Last Post: 09-27-2013, 08:27 PM
  2. Standard number format?
    By asmores in forum Forms
    Replies: 2
    Last Post: 03-22-2013, 08:31 AM
  3. Unlocking standard form layout
    By New_2_Access in forum Forms
    Replies: 4
    Last Post: 06-22-2012, 11:54 AM
  4. Replies: 2
    Last Post: 03-27-2012, 03:53 PM
  5. Standard format for Yes/No fields
    By coolpal9 in forum Forms
    Replies: 1
    Last Post: 01-20-2012, 04:56 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