Results 1 to 3 of 3
  1. #1
    behnam is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2014
    Posts
    72

    Cool How to refer to the Month of a date field type to be used in a query

    Hi all,

    In my table i have two fields called resolved which is represented by a checkbox and one called date which is a date type (ie. 5/13/2014). First i wrote a query that returns a count of all the records that have resolved checked and placed it in a textbox with the following code.


    Code:
    Text16 = DCount("[Resolved?]", "Power Outages", "[Resolved?]=true")
    how can i modify this code to not only check for which boxes are checked but also the month for the date has to be january.


    Thank you

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    The 3rd section of DCOUNT is the where clause. Add MONTH to the query "Power Outages"

    text16 = DCount("[Resolved?]", "Power Outages", "[Resolved?]=true and [month]=1")

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

Similar Threads

  1. Date Field to Month Field
    By Canadiangal in forum Access
    Replies: 4
    Last Post: 03-09-2013, 10:37 AM
  2. Replies: 3
    Last Post: 04-01-2012, 01:40 PM
  3. Refer to ONLY THE MONTH??
    By taimysho0 in forum Programming
    Replies: 18
    Last Post: 01-27-2012, 01:12 PM
  4. Replies: 10
    Last Post: 08-08-2011, 01:55 PM

Tags for this Thread

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