Solved

How to compare TimeValues ???

Posted on 1998-10-05
3
227 Views
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
0
Comment
Question by:kaber
  • 2
3 Comments
 
LVL 7

Expert Comment

by:spiridonov
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).
0
 
LVL 3

Accepted Solution

by:
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..
0
 
LVL 7

Expert Comment

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

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
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…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now