Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Statement, How to?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00491913
Message ID:
00492012
Vues:
19
Larry:

I don't think the query you posted will work correctly assuming that INVOICE is a unique field. The sub-query will return an entry for every single invoice in the table and therefore, so will the outside query.

How about this:
SELECT invoice,date,amount,file_num ;
FROM invoices WHERE DTOS(date)+invoice=;
(SELECT MAX(DTOS(date)+invoice) FROM invoices) ;
INTO CURSOR result


The sub-query will get the maximum invoicenumber of the maximum date and return just that single record to the outside query.

--Brad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform