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:
01365673
Vues:
15
Daniel,

Re-read your original message. I think I implemented it according to your requirements as I understood them. Now I see you wanted it differently. I will re-code, again it should be quite easy, but I would not have time today and so I will look at this after Shabbath ends.

Please post several correct input records and desired output in the meantime.

>Hi Naomi,
>
>The query executes fine but does not return the result I am looking for.
>
>The problem is with grouping by EDP. The result return nPVC and nSVC values based on the max(date) but if the max record includes either nPVC or nSVC = 0 than I need the last none 0 value.
>
>Results of your query:
>EDP SVC PVC
>23733 12.12 0.00
>25555 100.12 111.12
>
>Should be
>EDP SVC PVC
>23733 12.12 15.12
>25555 100.12 111.12
>
>I ended up using cursor and processing one record at the time. This is probably the least efficient way of acomplishing this task but at least it does work.
>
>Thank you,
>daniel
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform