Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DATETIME Question
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01083372
Message ID:
01083774
Vues:
12
>Ok. How would I use DATEDIFF in the following SQL? I want to test to
>see if a specified date falls in a certain range of dates
>
>
>
>SELECT *;
> FROM MyTable;
> WHERE BETWEEN(MyDate, dStartDate, dEndDate)
>
>

of course, dStartDate, dEndDate are metadata
SELECT *;
 FROM MyTable;
 WHERE datediff(d,dStartDate,getdate()) 
            between 0 and datediff(d,dStartDate,dEndDate)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform