Results 1 to 6 of 6
  1. #1
    bespra is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2010
    Posts
    20

    Unhappy Query for specific month

    How do I create a parameter for querying the start date (format is mm/dd/yyyy) so that the user can get a specific month? I tried using [Enter date mm/yyy] but I only get the first day of a month.

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Can you explain in a little more detail what you need to happen?

    What do you want your query to display when the user types in 03/2011 - for example?

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    You need to construct a field in query by expression that provides a value that can be filtered.

    Format([date field],"mm/yyyy")

    Place the input parameter prompt in the criteria for this constructed field.

    I don't use input parameter prompts. Can't validate entry. I have users input value in controls on form and refer to the controls as parameters.
    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.

  4. #4
    bespra is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2010
    Posts
    20
    We have data input monthly from the 1-30 each month. When they want to review the data for a previous month I need a way for it to filter the master table for only that month with all the data for that month.

  5. #5
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    June7's idea is a good one.

    Create a new field in your query - like he said:
    You can do something like this for your new field:
    SearchDate: Format([date field],"mm/yyyy")

    Then make your parameter on that SearchDate field.

  6. #6
    bespra is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2010
    Posts
    20
    Thank you, that works great

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

Similar Threads

  1. Query group by month and sum
    By Adele in forum Queries
    Replies: 4
    Last Post: 07-13-2011, 09:09 AM
  2. First of the Month, Following 2 Months in Query
    By sainttomn in forum Queries
    Replies: 5
    Last Post: 07-06-2011, 03:51 PM
  3. Track capacity changes month by month
    By Nils in forum Database Design
    Replies: 1
    Last Post: 02-18-2011, 03:03 PM
  4. Replies: 5
    Last Post: 11-15-2010, 06:12 PM
  5. SQL Query by day to end of month
    By tcasey in forum Queries
    Replies: 0
    Last Post: 10-07-2008, 09:55 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