Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2014
    Posts
    5

    Adding a field to a query that is not one of the fields in the tables

    Hi I am trying to add the field "Month to my query, I need to get total monthly sales for any given year and I don't know how to include the field "month" into the query.



    Can anyone help?

    Regards
    Don

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    What fields are in the Table you are trying to query? If we are to help you, you are going to have to provide some info and details of What you have and What you want as output.

  3. #3
    Join Date
    Feb 2014
    Posts
    5
    I have "SalesPerson" "Sales" and "SalesDate" I need to be able to get the total monthly sales for each salesperson for any given year. So I need to have the Month displayed in the query along the " " " . Sorry I am very new at this.

  4. #4
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    in the query in design view; in a blank column add: SalesMonth: format([SalesDate],"m")

    this will result in the numeric value of the month

  5. #5
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    forgot to add:
    mmm will result in short text of month i.e. Dec
    mmmm will show full month name

  6. #6
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Here are a couple of links that you should also be familiar with.
    SUM () http://www.w3schools.com/sql/sql_func_sum.asp
    Group BY http://www.w3schools.com/sql/sql_groupby.asp

    Good luck.

  7. #7
    Join Date
    Feb 2014
    Posts
    5
    Thank you that worked well

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

Similar Threads

  1. Replies: 1
    Last Post: 08-06-2013, 07:52 PM
  2. Replies: 1
    Last Post: 10-28-2012, 07:23 PM
  3. adding fields in query
    By slimjen in forum Queries
    Replies: 6
    Last Post: 09-24-2011, 09:06 PM
  4. Replies: 1
    Last Post: 09-15-2011, 08:45 AM
  5. Replies: 5
    Last Post: 08-05-2011, 12:33 PM

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