December 21, 2007, 02:00 PM
ktnjSelect Max Smart Date
Hello,
Can anyone tell me how to select the most recent rpt_d rows from this DB2 table,
when I don't know what the most recent date is.
I looking for something like MAX.Rpt_d, but
that doesn't work.
FIELD=RPT_D ,RPT_D ,MDYY ,DATE
Thanks to all,
Ken
December 21, 2007, 02:02 PM
ktnjAdded:
Z/OS WebFocus 716
December 21, 2007, 02:04 PM
GinnyJakesTry BY HIGHEST RPT_D.
December 21, 2007, 06:33 PM
Darin Leequote:
BY HIGHEST RPT_D.
better yet BY HIGHEST 1 RPT_D (so you don't get ALL the records). I'm sure that's what Ginny meant, but it's almost quittin' time and i'm grumpy (yes, it's because of a WF problem) so I mentioned it anyway.
December 21, 2007, 09:34 PM
LeahI don't do passthru much but you can use a select max of a field in DB2 land. If you have other selection criteria you can include that in the select statement. I some times use
SUM MAX.fieldname
BY sortfield
to get what I want.
December 27, 2007, 07:53 AM
ktnjThanks to all.
MAX or By highest 1 will solve the problem.