Results 1 to 4 of 4
  1. #1
    NightWalker's Avatar
    NightWalker is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2016
    Location
    Midwest USA
    Posts
    253

    Query date entry

    I am trying to change this code so I do not have to enter a start date and an end date. I would like to enter just a month to receive the summary for the entire month. Here is the code I currently am using.

  2. #2
    NightWalker's Avatar
    NightWalker is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2016
    Location
    Midwest USA
    Posts
    253
    having troubles posting the code. every time I try to post my code it gives me a 503 error.

    I am currently using CDate and a message box for "Enter Start Date" an another Message box for "Enter stop date"

    I am trying to just enter a month number to get the summary for that whole month.

    I have researched it and found Month() function but I could not get it to just replace The CDate function.
    Last edited by NightWalker; 07-05-2016 at 02:29 PM. Reason: clarification

  3. #3
    NightWalker's Avatar
    NightWalker is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2016
    Location
    Midwest USA
    Posts
    253
    Click image for larger version. 

Name:	code.PNG 
Views:	6 
Size:	19.0 KB 
ID:	25117

    Here is my code. Is it possible to change it to select whole months using the month function or change it to be able to make it select an entire month by entering a number for a month.

  4. #4
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    First, avoid using "Date" as a field name or alias. "Date" is an MS Access reserved word and you run the risk of getting errors (and confusing anyone who reads your code....!)

    Try a WHERE like this:

    Where month(qry_343sTested_Step1.TestedDate) = [Enter month Number]

    Note that this could give you erroneous results if your query contains data for more than one year.

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

Similar Threads

  1. Replies: 2
    Last Post: 04-13-2015, 10:49 AM
  2. Replies: 1
    Last Post: 01-18-2014, 08:33 PM
  3. Replies: 2
    Last Post: 05-20-2013, 05:23 PM
  4. Automatic Date Entry
    By Al77 in forum Access
    Replies: 3
    Last Post: 02-27-2012, 12:06 PM
  5. Date entry
    By kellyd in forum Access
    Replies: 3
    Last Post: 09-24-2009, 02:23 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