How to compare TimeValues ???

Posted on 1998-10-05
Last Modified: 2010-03-19
I try to compare 2 differtent TimeValues via "<" ">" like

Select * from Time where time.time1 < 'enteredTime' .
I did it from my code in Visual Basic , but get always an ODBC - called faild ! Hope someone can help me ... ThanX
Question by:kaber
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Expert Comment

ID: 1090380
'ODBC call failed ' is only the first part of ther error ,what does full text says?
Also, run SQL Trace when executing this query,and see what is actualy being sent to the server (and post here).

Accepted Solution

TheAnswerMan earned 30 total points
ID: 1090381
Do this..

ls_SQL = "SELECT * FROM TimeTable WHERE " _
        & " TimeTable.Time1 < " _
        & "'" & format(enteredTime,"HH:MM:SS") & "'"

'or whatever format your Time1 field is..

Expert Comment

ID: 1090382
The proposed answer will not work. In SQL Server date and time are stored in the same field.

Featured Post

Myth Busting: MongoDB Scalability (it scales!)

I was talking with one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. He mentioned to me that several customers have been telling him that “MongoDB doesn’t scale!” MongoDB’s scalability was in question?

My response was, “Is that a joke?"

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question