Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Year to Date calculation

2650333Feb 22 2017 — edited Mar 1 2017

I have a DailyStock pricing available. Need to calculate MTD and YTD prices for a stock

Trying to multiply daily values everyday until current day for MTD.

Column_Date    ColumnA         (Desired output -ColumnB)

D1                            A1              A1

D2                            A2             (A1*A2)

D3                            A3             (A1*A2*A3) and so on

Can you please help me to find SQL or DB2 query to implement the desired output.

This post has been answered by mathguy on Feb 22 2017
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 29 2017
Added on Feb 22 2017
20 comments
2,402 views