Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Function to determine the minimum or maximum date/time from a list of values

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Function to determine the minimum or maximum date/time from a list of values
 Login/Join
 
Expert
posted
I was hoping to use the MAX function to determine the maximum value from a list of date/time values.

I get this error: (FOC281) ALPHA ARGUMENTS IN PLACE WHERE NUMERIC ARE CALLED FOR

obviously, because MAX appears to be a Numeric function.

There is no Standard Date/Time function to do this?

Thank you.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
What is the field type? I'm using
TIMESTAMP/HYYMDS = ...

and I was able to use the MAX.TIMESTAMP and get it to return correctly. But I am using WebFocus 7.61 and perhaps it has changed in the recent versions (seeing you're using 5.3)


Prod: WebFOCUS 7.6.4 - Self Service - Windows Server2003 - Apache Tomcat 5.5
Dev: WebFOCUS 7.6.4 - Self Service - Windows XP SP2 - Apache Tomcat 5.5
 
Posts: 96 | Location: Winnipeg, Manitoba, Canada | Registered: January 22, 2004Report This Post
Virtuoso
posted Hide Post
We're on 7.1.6 and we use MAX on alpha fields all the time with no problem. I can't think of an example where we've used it on a date field, but I'm sure we have somewhere along the way. Do you have some code we can look at?


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
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Virtuoso
posted Hide Post
I presume you mean MAX(date1,date2,date3). No standard function and the alternative, which I have done is horrible, really horrible. You can have it if you are desperate!


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Virtuoso
posted Hide Post
You meant the MAX function instead of the MAX prefix, right? Was misdirected by Leo's comment - but is there a reason why the prefix wouldn't work instead?


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
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Expert
posted Hide Post
I want to use the MAX FUNCTION to determine the maximum value from multiple columns in one ROW. The MAX function works with numeric columns only, it would be nice to have an HMAX function...

something like this:

LAST_UPD_DATE_TIME/HYYMDS = MAX(FEQ_USER.ADD_DATE_TIME, FEQ_USER.UPD_DATE_TIME, FEQ_USER_GROUP.ADD_DATE_TIME, FEQ_USER_GROUP.UPD_DATE_TIME, FEQ_USER_GROUP_XREF.ADD_DATE_TIME, FEQ_USER_GROUP_XREF.UPD_DATE_TIME);

This message has been edited. Last edited by: Francis Mariani,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
You're right - make sense that there should be something like that. To get around it, you could create a second column for each date subtracting it from current date/time. This would give you a numeric column that you could use with the MIN function. Or you could convert each date column to JULIAN which is a numeric format that you could use with MAX. (But I guess that would only work for dates, not date/time)


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
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
Virtuoso
posted Hide Post
Something like this:

DNOW/HYYMDm=HGETC(10,'HYYMDm');
DIFF1/D12=HDIFF(DNOW,DATE1,'DAY','D12');
DIFF2/D12=HDIFF(DNOW,DATE2,'DAY','D12');
DIFF3/D12=HDIFF(DNOW,DATE3,'DAY','D12');
MINDIFF/D12=MIN(DIFF1,DIFF2,DIFF3);
MAXDATE/YYMD=IF MINDIFF EQ DIFF1 THEN HDATE(DATE1,'YYMD') ELSE IF MINDIFF EQ DIFF2 THEN HDATE(DATE2,'YYMD') ELSE IF MINDIFF EQ DIFF3 THEN HDATE(DATE3,'YYMD') ELSE ' ';


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
 
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Function to determine the minimum or maximum date/time from a list of values

Copyright © 1996-2020 Information Builders