Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to store time (not date) in SQL and query from VFP
Message
 
 
À
06/03/2008 11:54:29
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01297626
Message ID:
01299339
Vues:
37
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--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform