Hi, Ive been trying to calculate standard deviation from the data in my datagridview.I have manage to work out how to get to the last value but would like to display in a chart so i need to have some kind of running total like you have in Excel. For instance a 20 day Standard deviation would be displayed from the 20 data row and runs all the way to the last value data row. do i need to use some kind of array function.

thanks for you help.

So you want to fetch last 20 records from the database. Isn't it?

At the moment ive set it up as a loop to capture the last 20 data rows to calculate the SDeviation. What i need is to start at the first 20 rows and calculate it all the way through to the last value. Kind of like a running total.

thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.