Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2005
    Posts
    91

    Unanswered: Need Help Constructing Time Query From A Text Box

    I don't know why this is so painful but I am having problems with creating a query that takes two time input parameters from a form. The first parameter is the start time and the second parameter is the end time. The input coming from the text boxes is based on a 24 hour clock which has the following input mask 00:00. Below is a snippet of the code that I am using to query my database.

    report.date >= [forms]![frmTrip_report]![txtStartDate] and
    report.date <= [forms]![frmTrip_report]![txtFinishDate] and
    report.time >=[forms]![frmTrip_report]![txtStartTime] and
    report.time <=[forms]![frmTrip_report]![txtFinishTime]


    Thanks in advance for the help!

  2. #2
    Join Date
    Jan 2007
    Location
    California, USA
    Posts
    520
    Access handles date/time fields very nicely, so why not put your start date and time in ONE field, and same with end date and time?
    Dim StartDateTime as Date
    StartDateTime = txtStartDate + txtStartTime
    etc.
    Then in your query, Between StartDateTime and EndDateTime

    HTH,

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I don't understand the question...
    Wait, what question?
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •