Results 1 to 4 of 4
  1. #1
    Brian62 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2009
    Posts
    147

    Create a Query for Yes field and Between Dates field

    I have a query that I am trying to pull information from a yes/no field that is for open studies and a date field. The date field is for studies that have closed.



    I need to capture all current open studies and all past closed studies that were closed during a specific time frame.

    Is there a way for me to get the two to work?

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    It all depends on how you define what is "open" and whatnot. Just something simple given from what you described would be using the following WHERE clause

    WHERE yes/nofield = yes and datefield BETWEEN #date# AND #date#
    or yes/nofield = no and datefield BETWEEN #date# AND #date#

  3. #3
    Brian62 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2009
    Posts
    147
    I tried your solution and it comes up with no records.
    I have to capture what is open which will be yes (yes/no check box= unchecked) and what closures there were during any period of time for instance between 06/01/09 and 05/31/10.

    I have to capture both to show on one report versus 2 that I have now through the query.

    Activestudy
    Where
    =yes

    Closure
    Where
    Between #6/1/2009# And #4/26/2010#

    Also tried

    Between [Enter Start Date Like: 01/01/09] And [Enter End Date Like: 12/31/09]
    (Which I prefer to use)

    I hope this helps.

  4. #4
    Brian62 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2009
    Posts
    147
    This was the fix I received from another forum. This worked for me with a little tweak.

    In the criteria of the date field you should just need:

    (Between [Enter Start Date Like: 01/01/09] And [Enter End Date Like: 12/31/09]) or is null

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

Similar Threads

  1. create new column-name it from form field
    By hyperionfall in forum Forms
    Replies: 6
    Last Post: 03-04-2010, 01:53 PM
  2. Replies: 3
    Last Post: 02-17-2010, 02:29 PM
  3. Urgent issue! Create field for intervals
    By Bjorn in forum Queries
    Replies: 3
    Last Post: 02-10-2010, 10:26 AM
  4. Replies: 5
    Last Post: 09-16-2009, 05:22 PM
  5. How to Create Field in Template
    By Jonathan in forum Access
    Replies: 1
    Last Post: 01-30-2009, 02:00 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