Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Statement, How to?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00491913
Message ID:
00492012
Views:
20
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform