Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query design help
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2005
Application:
Desktop
Divers
Thread ID:
01365555
Message ID:
01365691
Vues:
11
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform