Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Use Max() is SQL
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7
OS:
Windows XP
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00986746
Message ID:
00986750
Vues:
32
>I am to use the MAX() function in an SQL statement. Keying on the maximum date in the PKGDATE field. But is not working, do anyone have any suggestions on how I can do this. See example below.
>
>SELECT DISTINCT SUBSTR(pkgname,1,3), pkgdate, clientver FROM Pkgsrcvd INTO TABLE LAST_TRANSMITTED ;
>WHERE MAX(PKGDATE) AND !EMPTY(clientver) ORDER BY 1
>
>
>Thank You In Advance
>
>
>
>Winfred Majors

Not sure if I understood correctly, Something like this?

ldKeyedMaxDate=SomeDate()
select SUBSTR(pkgname,1,3) as pkgname, clientver, max(pkgdate) as maxpkgdate from Pkgsrcvd INTO TABLE LAST_TRANSMITTED ;
group by 1, 2 having maxpkgdate=ldKeyedMaxDate
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform