Results 1 to 5 of 5
  1. #1
    Joopster is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    8

    Date and Time Query Off Of Form


    I have a form with begindate and enddate text fields.

    I have my database set up with Date and Time added to each record.

    On form frmwhatdates I want to run a report based on the date and shift. I want to add a radio button for 1st shift (0630-1430) 2nd shift (1430-2230) and 3rd shift (2230-0630) that would be selected for which report to run on frmwhatdates form.

    So if on 2/9/2012 3rd shift is selected it will return results from 2/8/2013 at 2230 through 2/9/2013 to 0630.

    I am able to return results with date but I cannot get the time figured out...

    Please point me in the right direction.

    Thanks

  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,640
    It is unclear whether your data is in a single date/time field, or two separate fields (I'd use a single field). You should be able to populate two text boxes with the appropriate date/time values based on the date and shift, the let your query use those two text boxes.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Joopster is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    8
    Quote Originally Posted by pbaldy View Post
    It is unclear whether your data is in a single date/time field, or two separate fields (I'd use a single field). You should be able to populate two text boxes with the appropriate date/time values based on the date and shift, the let your query use those two text boxes.
    I have figured out how to use the radio buttons and set up the criteria in order to return results for 1st and 2nd shift because they occur on the same date as I am running the query.

    IE 2/19/2013 returns results for just 1st shift on that date or just 2nd shift.

    The problem I am having is setting the criteria for the 3rd shift query that will return results from 2/18/2013 at 22:30 thru 2/19/2013 at 0630.

    Database has time in one field and date in another.

    Any help would be appreciated.

    Thanks.

  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,640
    What is the code that works for the first two?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Joopster is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    8
    Time Field Criteria:

    Between TimeSerial(6,30,0) And TimeSerial(14,30,0)

    Date Field Criteria:

    [Forms]![frmwhatdates]![begindate] And [Forms]![frmwhatdates]![enddate]

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

Similar Threads

  1. Date/Time Field Query...
    By Coffee in forum Queries
    Replies: 5
    Last Post: 07-05-2011, 11:27 PM
  2. Replies: 7
    Last Post: 05-31-2011, 11:51 AM
  3. Replies: 6
    Last Post: 01-04-2011, 05:43 PM
  4. Query Date without comparing time
    By Bosco in forum Queries
    Replies: 5
    Last Post: 06-28-2010, 03:59 PM
  5. Date/Time entry field on a form
    By Ted C in forum Forms
    Replies: 1
    Last Post: 06-22-2010, 12:28 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