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     [CLOSED] Date Conversion

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Date Conversion
 Login/Join
 
Gold member
posted
Hi All,

I have a Data like this

FIELD_DATE
01/28/2010
05/22/2010
02/16/2011
03/18/2011

I would like to convert in this format

i have to display only Month and year only

FIELD_DATE
Jan 10
May 10
Feb 11
Mar 11


can any one tell me how to do i'm new to webfocus plz

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


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 51 | Registered: December 01, 2010Report This Post
Virtuoso
posted Hide Post
Deepu
Did you do a search on this issue?

This is in fact rather basic, but it depends on the internal format of you field_date

Suppose it is a smartdate in your database

then

DEFINE FILE XXX
FIELD_NEW/tMYY=FIELD_DATE;
END
TABLE FILE XXX
PRINT 
FIELD_DATE FIELD_NEW
END


but please ...Read your manuals, use the application help function, do a search on this form.
And finaly....buy the excelent book I have pointed to many many times.




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
Gold member
posted Hide Post
quote:


That field in format alpha FIELD_DATE(A10) i need to convert in integer

I have a Data like this


FIELD_DATE
01/28/2010
05/22/2010
02/16/2011
03/18/2011

I would like to convert in this format

i have to display only Month and year only

FIELD_DATE
Jan 10
May 10
Feb 11
Mar 11


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 51 | Registered: December 01, 2010Report This Post
Expert
posted Hide Post
It appears to be more complicated than I thought!

This doesn't work on a Date field: TEMP_DATE/MtD. Other Date formats work, but just Month and Day do not (see code below).

Without converting the Date to a Date/Time field, it appears you must use a combination of EDIT, CHGDAT and LCWORD.

Hopefully there's a better way.

DEFINE FILE CAR
ORIGINAL_DATE/A10 WITH COUNTRY = '11/28/2010';
END

TABLE FILE CAR
PRINT

COMPUTE FINAL_DATE1/A6 = CHGDAT('MDYY', 'MTD', EDIT(ORIGINAL_DATE,'99$99$9999'), 'A6');

COMPUTE FINAL_DATE2/A6 = LCWORD(6, FINAL_DATE1, 'A6');

ORIGINAL_DATE

COMPUTE DATE1/A8MDYY = EDIT(ORIGINAL_DATE,'99$99$9999');

COMPUTE TEMP_DATE/YYMD = DATE1;

TEMP_DATE/YMD
TEMP_DATE/YYM
TEMP_DATE/YM
TEMP_DATE/MtDYY
TEMP_DATE/MtDY
TEMP_DATE/MtYY
TEMP_DATE/MtY
TEMP_DATE/Mt
TEMP_DATE/M
-*TEMP_DATE/MtD
TEMP_DATE/YYQ
TEMP_DATE/YQ
TEMP_DATE/Q

WHERE RECORDLIMIT EQ 1
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
Virtuoso
posted Hide Post
WebFOCUS can format a SmartDate as 'Mmm, YY' or as 'MM YY', but for some reason it cannot chew Bits and rub it's logo at the same time - no combination of MY and Bt seems to work:

DEFINE FILE CAR
 ORIGINAL_DATE/A10 WITH COUNTRY = '11/28/2010';
 ALPHA_DATE/A8MDYY = EDIT(ORIGINAL_DATE,'99$99$9999');
 SMART_DATE1/MBY = ALPHA_DATE ;
 SMART_DATE2/MtY = ALPHA_DATE ;
END

TABLE FILE CAR
 PRINT
  ORIGINAL_DATE
  ALPHA_DATE
  SMART_DATE1
  SMART_DATE2
 WHERE RECORDLIMIT EQ 1 ;
END


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Expert
posted Hide Post
Correction on my previous post - for some reason I though the requirement was for Month/Day (MtD), while it's really for Month/Year (MtY).

So, MtY is no problem, but MtD is not possible and I cannot figure out why - I'd love to open a case.


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     [CLOSED] Date Conversion

Copyright © 1996-2020 Information Builders