Results 1 to 6 of 6
  1. #1
    TrevorM is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    9

    Dates from and too query

    Hi All,

    I have a question and Its a bit of a hard one,

    I have made a vehicle database which lists when equipment goes on breakdown/down time with a from and two fields,

    I have a query currently in place using "between (FromDate) and (ToDate)" under the From field only to show anything that went "on" breakdown between these dates and is working well but there is a greater issue


    For example I have
    Car 1 on breakdown from 01-Sept-13 to 30-Nov-13
    and
    Car 2 on breakdown from 01-Oct-13 to 30-Oct-13.

    If I search from 15-Sept-13 to 15-Nov-13 I will find Car 2 as its between the dates, but Car 1 is not showing it, by right is still on breakdown on the dates of my query search as it went on and off before and after the defined dates.

    Is there a way i can include items like these events?

    Hope this makes sense.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    TrevorM is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    9
    Yeah deffintily does thats exactly what Im looking for, thanks heap, will try to put it into action and see how i go,

    Many many thanks been self teaching everything I know in the last 1-2 weeks and this is what stumped me, thanks again.
    -Trev

  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,652
    No problem, and welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    TrevorM is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2013
    Posts
    9
    No worries thanks for the welcome,

    With the "SQL" info that's the Query isn't it as I have learned it means "Structured Query Language"

    I load the search code/criteria in to the design view of my query under the Criteria section or do i run this with in a Macro/Module?

    Currtly my "Breakdown From" has the following Criteria (Between [Forms]![Menu - BreakDown Report]![BrkDwnFrom] And [Forms]![Menu - BreakDown Report]![BrkDwnTo]) as the dates it uses to search is collected from a form as they will never be the same month to month.

    Thanks

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    It can just be a query. The key is that rather than using Between on one field you're "testing the given start date against the end date in the table, and the given end date against the start date in the table."
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 1
    Last Post: 10-18-2013, 03:14 PM
  2. IIf Query with dates
    By DelbyJones in forum Access
    Replies: 2
    Last Post: 08-16-2012, 02:33 PM
  3. Query input dates for range of dates in two fields
    By kagoodwin13 in forum Queries
    Replies: 3
    Last Post: 02-13-2012, 04:25 PM
  4. Replies: 10
    Last Post: 11-16-2011, 10:58 AM
  5. Run Query by dates
    By BorisGomel in forum Access
    Replies: 3
    Last Post: 07-21-2011, 03:54 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