Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Re: How To
Miscellaneous
Thread ID:
00689033
Message ID:
00689483
Views:
32
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--
Previous
Reply
Map
View

Click here to load this message in the networking platform