Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Jan 2001
    Location
    Denver, Colorado, USA
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Creating a sum calculation for a particular month (Access XP)

    Hello, I want to sum the number participants in classes we offer for just one month. I can write the query so that all months show but just need one particular month to show.

    So I want to write it for February then March and so on. Thanks

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Creating a sum calculation for a particular month (Access XP)

    In your query, add a field with the following expression :
    Month([YourDateField])
    In the criteria line of this column enter :
    [Enter the month]
    Each time you will run this query, it will ask you for the wanted month, and render you the records for that month.
    If you want, you can extend it to the year also. the column should be:
    Format([YourDateField],"mm/yyyy")
    The question would be :
    [Enter Month and Year in fomat mm/yyyy]
    HTH
    Francois

  3. #3
    Lounger
    Join Date
    Jan 2001
    Location
    Denver, Colorado, USA
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Creating a sum calculation for a particular month (Access XP)

    Thanks, this works and helps with one issue.

    Now another issue, how would I write the expression if I wanted to set the month myself rather than ask the user for the criteria.

    For instance my date field is called 'dtDate' and I want to know just for 02/2004.

    Thanks

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Creating a sum calculation for a particular month (Access XP)

    Use Francois' second suggestion: create a calculated column Format([dtDate],"mm/yyyy"). Instead of entering a parameter prompt in the Criteria line, enter the month in the format "mm/yyyy", in your example "02/2004".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •