Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Filter On DateTime Field with notime
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00742929
Message ID:
00742942
Vues:
12
I would use
declare @ttRecoveryStart datetime
declare @ttRecoveryEnd datetime
set @ttRecoveryStart = '10/01/2002 00:00:00'
SET @ttRecoveryEnd = DATEADD(ss, 86399, @ttRecoveryStart)
select * from meetings 
	where EnterRecovery between @ttRecoveryStart and @ttRecoveryEnd
>I have two fields EnterRecovery DateTime and ExitRecovery DateTime. I need to filter a query where these fields have 00:00:00 for the time portion. They will always have the date portion. Some of my records have times in them, others don't.
>
>Can I just use some like
>
>declare @ttRecoveryBetween datetime
>set @ttRecoveryFrom = '10/01/2002 00:00:00'
>
>select * from meetings
>where EnterRecovery between @ttRecoveryBetween and @ttRecoveryBetween
>
>
>
>Thanks
>Kirk
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform