Focal Point
Select Max Smart Date

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8621066262

December 21, 2007, 02:00 PM
ktnj
Select 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
ktnj
Added:

Z/OS WebFocus 716


December 21, 2007, 02:04 PM
GinnyJakes
Try BY HIGHEST RPT_D.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
December 21, 2007, 06:33 PM
Darin Lee
quote:
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.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
December 21, 2007, 09:34 PM
Leah
I 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.


Leah
December 27, 2007, 07:53 AM
ktnj
Thanks to all.

MAX or By highest 1 will solve the problem.