Results 1 to 5 of 5
  1. #1
    BigCat's Avatar
    BigCat is offline Vice Pres. of Napping
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    Box Canyon
    Posts
    52

    Question Periodic Query

    I am developing a procedure to query the same information from my table each month.



    So I was wondering if there was a statement I could add to my query statement that will grab only the records where the dates in the date column are within the current month.

    Something like 'WHERE [MFG COMP] = current month' or something along those lines.

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    use the MONTH() function. "where month(field) = month(date)"

    are you serious with this??

    you've been posting here for a while now....these are very basic functions in Access. How long have you worked with this program??

    kinda seems like some of your ?'s could be answered by simple google searching. are you a business owner and not have time to do this? just curious...

  3. #3
    BigCat's Avatar
    BigCat is offline Vice Pres. of Napping
    Windows XP Access 2007
    Join Date
    May 2011
    Location
    Box Canyon
    Posts
    52
    I guess I was unclear in my first post. I am making a procedure that I can just run at the end of the month so I wanted to know if there was a functionwhere it compare the field to the current month without having to go in and specify the date myself in the query string.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    I would not use the Month function (without accounting for year). I'd use Between and the appropriate functions from here:

    http://www.pacificdb.com.au/Support/...hfunctions.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by pbaldy View Post
    I would not use the Month function (without accounting for year). I'd use Between and the appropriate functions from here:

    http://www.pacificdb.com.au/Support/...hfunctions.htm
    agreed. also agreed that I'm off on this one.

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

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