Search query for Month MS Access

Posted on 2009-02-13
Last Modified: 2012-05-06
Hi Experts,

I am using MS Visual Studio .Net 2005 - I am using a MS Access as my back end. I have used this method of inserting date into the field:

Now that the dates are inserted, I am looking to create and run a query to search ONLY the month. I.E To search for records in august ONLY - I would like it to display an out put of all records in that month. I am aware of the fact that it will also display 2006, 2007 etc.. records but will like to sort it newest entry order.

Any help relating in compiling this query within MS Visual Studio 2005 .Net c# using MS Access as my database will be appreciated.


Question by:introlux
    LVL 2

    Accepted Solution


    In Access it should be something like

    SELECT .....
    FROM ....
    WHERE Month([date_filed_name]) = 8
    LVL 74

    Assisted Solution

    by:Jeffrey Coachman

    ...If you want a parameter prompt to pop-up so you can type in month value, you can modify the above code slightly:

    SELECT .....
    FROM ....
    WHERE Month([date_filed_name]) = [Enter a Month Number]

    (Of course you can build an interface in Access with a drop down displaying months from which to choose from, but that is another issue.)


    Author Closing Comment

    This works! Thanks for the reply!

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
    Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now