I'm sure this will be a quick and easy one for you guys ...
I have a very simple database that stores the price of a commodity and the date that price was reported. What I need to do is display the date and price (which I have already done), but I need to also display the difference between the current price and the previous price. So, this week (9/7), it is 12.23, last week (8/31) it was 12.02, and the week before (8/24) it was 12.15. I need to know how to display it like this:
9/7/11 $12.23 +$0.21 +1.75%
8/31/11 $12.02 -$0.13 -1.07%
8/24/11 $12.15 +$0.18 +2.11%
Where the difference and percentage is calculated based on the date and price.
I have the following code in the webpage to return the Price and Date:
cmdSelect= New OleDbCommand( "SELECT * From OREO", objConn)
Response.Write(dtrReader("CurrentPrice") & " - " & dtrReader("PriceDate") & "<br>")
I am using Access for the database.