Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query design help
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Application:
Desktop
Miscellaneous
Thread ID:
01365555
Message ID:
01365691
Views:
10
>Thank you for you reply. It is possible that my spec were not clear enough.
>
>Sample data
>EDP           SVC         PVC               DATE
>23733	10.12	15.12	2008-12-01 00:00:00.000
>23733	12.12	0.00	2008-12-02 00:00:00.000
>25555	100.12	111.12	2008-12-02 00:00:00.000
>
>Expected result:
>23733	12.12	15.12	2008-12-02 00:00:00.000
>25555	100.12	111.12	2008-12-02 00:00:00.000
>
>
>The bottom line is when there are multiple records for one EDP I would like the PVC and SVC be taken from the max(date) UNLESS the value of either PVC or SVC is zero then I want the latest none zero value.
>
>Hope I made myslef clear.
>DAniel

Just one question - what if you have only single EDP record with 0, do you want this record included ?
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform