Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return just one record for each date
Message
 
To
07/10/2010 06:36:33
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2000
Miscellaneous
Thread ID:
01484187
Message ID:
01484325
Views:
30
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform