Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to find nearest date in select sql
Message
From
20/01/2007 07:25:43
 
 
To
20/01/2007 07:02:56
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01186568
Message ID:
01187317
Views:
18
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
Map
View

Click here to load this message in the networking platform