Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Return just one record for each date
Message
 
À
07/10/2010 06:36:33
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:
01484325
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform