>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