Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to store time (not date) in SQL and query from VFP
Message
 
 
To
06/03/2008 11:54:29
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01297626
Message ID:
01299339
Views:
35
You're forgetting about seconds?
where CONVERT(VARCHAR(10),runtime,108) <= '13:12:59'
>
>Any idea why in the 1st example below it only works correctly if I add one minute to the constraint? The first example only pulls 13:12 if I query for < = 13:13. Which will be faster (assuming the one not using CAST)? Will both work in SQL 2000? (I know they both work in 2005)
>
>
>SELECT * from schedl
>   where CONVERT(VARCHAR(10),runtime,108) < = '13:13'
>
>select * from schedl
>   where runtime - CAST(FLOOR(CAST(runtime AS float)) AS datetime) < = '13:12'
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform