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     [SOLVED] Date format for DD MMM YY

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Date format for DD MMM YY
 Login/Join
 
Member
posted
I can't seem to find any way to format a date field to be displayed like 25 DEC 08. The only format near this is myDate/DMTY which produces 25 DEC, 08. I know I can redefine and strip out the comma but I would there there is a standard formatting statement.
Thanks for the help!
Ed

This message has been edited. Last edited by: Kerry,


764 MS PDF
 
Posts: 4 | Registered: September 26, 2008Report This Post
Virtuoso
posted Hide Post
Ed

What is the internal format for this field?
(the master file description?)

Do you have the proper manuals for converting fields?

There is a very good and cheap book than gives you almost 1001 formulas to convert and calculate with dates that you should buy.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Expert
posted Hide Post
DEFINE FILE CAR
DATE0/A8YYMD = '20081225';
DATE1/DMTY = DATE0;
DATE2/A17 = CHGDAT('YYMD', 'DMTY', DATE0, 'A17');
END

TABLE FILE CAR
SUM
DATE1
DATE2
SALES
BY CAR
END


DATE1 is a normal date reformat which results in "25 DEC, 08".
DATE2 uses the "legacy" Date Format Change CHGDAT function and results in "25 DEC 08".


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
Member
posted Hide Post
FIELDNAME=ACTIVITYDATE, ALIAS=activityDate, USAGE=YYMMD, ACTUAL=DATE, $


764 MS PDF
 
Posts: 4 | Registered: September 26, 2008Report This Post
Member
posted Hide Post
Thanks, that worked for me. I am a bit surprised that there is not a built in 'current' function to do this w/o having to use the legacy CYHGDAT.


764 MS PDF
 
Posts: 4 | Registered: September 26, 2008Report This Post
Platinum Member
posted Hide Post
Look at the DATETRAN function.


Reporting Server 7.6.10
Dev. Studio 7.6.8
Windows NT
Excel, HTML, PDF
 
Posts: 204 | Registered: March 31, 2008Report This Post
Master
posted Hide Post
You could put a define in you MFD using Francis' CHGDAT and then the format would be available anytime you used that file.


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Expert
posted Hide Post
Rick man,

DATETRAN appears to have won the prize for most annoying syntax in a function. I can't get it to work. Would you be so kind as to give us an example of how to make this function output the requested date format?

This doesn't work:

DEFINE FILE CAR
DATE0/YYMD = DATECVT('20081225', 'A8YYMD', 'YYMD');
DATE1/A15 = DATETRAN(DATE0, '(MDYY)', '(BT)', 'EN', 15, 'A15');
END

TABLE FILE CAR
SUM
DATE0
DATE1
SALES
BY CAR
END


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
Guru
posted Hide Post
This seemed to work for me in R766(win):

DATE1/A15 = DATETRAN(DATE0, '(DMY)', '(BT)', 'EN', 15, DATE1);


ttfn, kp


Access to most releases from R52x, on multiple platforms.
 
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003Report This Post
Platinum Member
posted Hide Post
Try this:
DATE1/A11 = DATETRAN(DATE0, '(DMYY)', '(-T)', 'EN', 11, 'A11');


Reporting Server 7.6.10
Dev. Studio 7.6.8
Windows NT
Excel, HTML, PDF
 
Posts: 204 | Registered: March 31, 2008Report This Post
Expert
posted Hide Post
Rick Man,

Thank you, but that results in "25-DEC-2008", not what EdG is looking for. He would like "25 DEC 08".

DATETRAN must be a commissioned function - written by a non-IBI programmer, it's the only way to explain why the syntax for this function is completely different than the other date functions. What are those brackets for? And, according to the manual, format option 'T' "Displays month as an abbreviated name with no punctuation, all uppercase." It doesn't state how to output the day and year.


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
<JG>
posted
DEFINE FILE CAR
DATE0/YYMD = DATECVT('20081225', 'A8YYMD', 'YYMD');
DATE1/A15 = DATETRAN(DATE0, '(DMY)', '(BT)', 'EN', 15, 'A15');
DATE2/A15 = LCWORD(15,DATETRAN(DATE0, '(DMY)', '(BT)', 'EN', 15, 'A15'),'A15');
END

TABLE FILE CAR
SUM
DATE0
DATE1 DATE2
SALES
BY CAR
END

This returns

CAR        DATE0      DATE1     DATE2     SALES 
ALFA ROMEO 2008/12/25 25 DEC 08 25 Dec 08 30200 
AUDI       2008/12/25 25 DEC 08 25 Dec 08 7800 
BMW        2008/12/25 25 DEC 08 25 Dec 08 80390   


BTW. the reason for being so weird is that it is the only date function
that accomodates NLS for formatting. That doe not explain the need for the ()though.

This message has been edited. Last edited by: <JG>,
 
Report This Post
Member
posted Hide Post
Using the DMTY format with Legacy dates (I6DMTY) does not include the comma after the month. Simply convert the Smart Date to a Legacy date without the need for subroutines.

DEFINE FILE CAR
DATE0/YYMD='20081225';
DATE1/I6DMTY=DATE0;
END
TABLE FILE CAR
PRINT DATE0 DATE1
BY COUNTRY
END

COUNTRY     DATE0           DATE1
-------     -----           -----
ENGLAND     2008/12/25  25 DEC 08
FRANCE      2008/12/25  25 DEC 08
ITALY       2008/12/25  25 DEC 08
JAPAN       2008/12/25  25 DEC 08
W GERMANY   2008/12/25  25 DEC 08


Robert Freeman

FOCUS for VM 7.6.x
 
Posts: 4 | Registered: November 12, 2003Report This Post
Expert
posted Hide Post
JG, thanks for the explanation. I finally get it.

The documentation seems a little unclear - it doesn't really suggest that the input type is also the output:

DATETRAN (indate, '(intype)', '([formatops])', 'lang', outlen, output)

intype - Is one of the following character strings indicating the input date components and the
order in which you want them to display, enclosed in parentheses and single quotation
marks.


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
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Date format for DD MMM YY

Copyright © 1996-2020 Information Builders