Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to find nearest date in select sql
Message
De
20/01/2007 07:25:43
 
 
À
20/01/2007 07:02:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01186568
Message ID:
01187317
Vues:
27
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform