Results 1 to 2 of 2

Thread: Time equality not being detected

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Posts
    225

    Time equality not being detected

    I have a table of bookings in my database. I have a query that takes a time entered by the user and checks whether there is a booking for that time. Although the time entered by the user is 7:40am and the time in the table is 7:40am when my sql statement is run it says there are no records, i.e. recordcount=0.

    I have been trying to make this work for a week now with no success. What am I doing wrong? I have even tried formatting the time field but it still doesn't work.

    HELP!!!

  2. #2
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    Time is not stored as "7:40PM", it is usually a longword that holds the number of milleseconds since midnight.

    You have to "bracket the value"
    Code:
    where format(appt_time,"HH:MM") > "19:39" and
            format(appt_time,"HH:MM") < "19:41"

Posting Permissions

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



Click Here to Expand Forum to Full Width