Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DateTime comparison
Message
 
À
03/04/2009 20:04:13
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Application:
Web
Divers
Thread ID:
01392907
Message ID:
01393234
Vues:
46
>Hi,
>How to use this function to have BETWEEN ... AND ... comparison?
>
>Thank you

Don't. Just use >= and < .
--- If you want ALL records between 01 Apr 2009 and 15 Apr 2009
DECLARE @StartDate datetime
DECLARE @EndDate datetime
SET @StartDate = '20090401'
SET @EndDate = '20090416' -- 16 not 15


SELECT .....
FROM ....
WHERE SomeDateTimeField >= @StartDate AND
      SomeDateTimeField <  @EndDate
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform