Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How To
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Re: How To
Divers
Thread ID:
00689033
Message ID:
00689483
Vues:
33
You're welcome.

>Hi Sergey,
>
>Yes, that is the one! Thanks.
>
>>I see. Try
Select Date, Code, Sum(Amount) as Total,
>>      (SELECT Sum(ord2.Amount) From Orders ord2
>>        Where fk_Customer = 1
>>          And Date Between '20020101' and '20021231'
>>	  And ord2.date() <= orders.date()
>>          And ord2.code = orders.code) AS RunTotal
>>  From Orders
>>  Where fk_Customer = 1 And Date Between '20020101' and '20021231'
>>  Group by Code, Date
>>  Order by Code, Date
I tested above query and it produces result you want.
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform