Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GetDate()
Message
De
07/11/2003 10:20:21
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Divers
Thread ID:
00847612
Message ID:
00847654
Vues:
23
>Is there a better way to get the current date without a time than this?
>
>dateadd(ms, datepart(ms, getdate())*-1, dateadd(ss, datepart(ss, getdate())*-1, dateadd(mi, datepart(mi, getdate())*-1, dateadd(hh,datepart(hh, getdate())*-1, getdate())))) - 1

convert(datetime, convert(varchar, GetDate(), 101))

fyi: today is 11/07, and the longer version above returns 11/06
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform