Solved

How to compare TimeValues ???

Posted on 1998-10-05
3
234 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
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…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

920 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

16 Experts available now in Live!

Get 1:1 Help Now