Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return just one record for each date
Message
De
07/10/2010 13:04:56
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01484187
Message ID:
01484350
Vues:
29
>Cetin,
>
>This is cool, does the FLOOR(CAST()) take it down to just numeric representation of the date?
>
>
SELECT  t1.*
>FROM    dbo.co_Pat_HeightWeightHistory t1
>        INNER JOIN ( SELECT FLOOR(CAST(TransactionDT AS float)) AS dGroup,
>                            MAX(TransactionDT) AS TransactionDT
>                     FROM   dbo.co_Pat_HeightWeightHistory
>                     WHERE  patientID = @PatientID
>                     GROUP BY FLOOR(CAST(TransactionDT AS float))
>                   ) t2 ON t1.TransactionDT = t2.TransactionDT
>WHERE   patientID = @PatientID
>order by pathwid Desc
>
Yes, if you cast that cast back to a datetime you would get just the date w/o time.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform