General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Am I right in assuming afterwards you calculate the average gain you made in that time interval by comparing the average price on which you bought and the average price an which you sold.
And in general, I would approach the computation you make in a different way:
I'd just sum up the total price of items sold in that time period, and the total quantity: sum(quantity*price) from tabSold. Then I'd sum up the prices*quantity of that number of items bought last, as you can only sell, what you bought before (well, if it's not software or something of that nature). Then you would really know what gain you made, not just an average gain. And you'd find out the time you had this item in stock, as that select of the last N items sold could give you a first date, when it was bought.
Bye, Olaf.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only