Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Latest price GROUP problem
Message
De
18/11/2013 23:49:59
 
 
À
18/11/2013 22:51:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01588299
Message ID:
01588300
Vues:
54
SELECT TOP 1. price FROM foo ORDER BY date DESC
will give you the latest price.


>Hi All:
>
>Consider
>
>
>Item#          Date        Price
>1111           2/3/04      111.22
>2222           2/3/05      111.22
>3333           2/3/06      111.22
>4444           2/3/07      111.22
>1111           2/3/08      222.22
>
>Select Item, max(date), Price ;
>from foo ;
>group by item ;
>into cursor boo
>
>
>I want the latest price, so this would be the result:
>
>
>Item#          Date        Price
>2222           2/3/05      111.22
>3333           2/3/06      111.22
>4444           2/3/07      111.22
>1111           2/3/08      222.22
>
>
>Problem is that VFP doesn't like this and generates an error GROUP BY clause missing. How do I solve this?
>
>Thanks,
>
>Yossi
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform