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] CONVERSION OF MDYY filed

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] CONVERSION OF MDYY filed
 Login/Join
 
Master
posted
I have searched the forum and found numerous discussions but not one the gets me exactly what I need. I also have an online functions manual but I am still unable to get something to work. I have a view with a date of type MDYY. I need the day number from that field. Ex: July 13 , 2013 would yeild: 13.

I tried using EDIT and wrapping that in a SUBSTR function but got an incompatible type error.

Is there something simple?

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Platinum Member
posted Hide Post
Is your feild a date/numeric field or a text string?

If its a text string, you would first need to make sure that it is always the same format, i.e the month should always be three characters for consistency and the day should always be two chars, and then a simple edit with a mask should get you the day component.

If its a date/numeric field, try using the built in date functions (i.e HEXTR)


Lloyd Prendergast
Michael Kors (USA), Inc.
Phone: 201-453-5076
Fax: 646-354-4776
Lloyd.Prendergast@Michaelkors.com


WebFOCUS 523
WebFOCUS 7.6
WebFOCUS 7.7

Windows Server 2005
Windows Server 2008

Iseries V5R3M0
Iseries V5R5M0
Iseries V6R1M0
 
Posts: 157 | Location: Secaucus, NJ | Registered: May 21, 2004Report This Post
Master
posted Hide Post
hovering over the field...Format: MDYY....was told its numeric...


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Expert
posted Hide Post
quote:
hovering over the field

Normally implies what the display format is. You need to know the actual format, found in the synonym or "?FF filename".
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Silver Member
posted Hide Post
Robert,
A Date type of MDYY often indicates a "SmartDate" datatype field.
You may extract individual components in this manner (SD_MDY2 is an MDY SmartDate field):
a)  YR1 /YY    = SD_MDY2;  
b)  MO1 /MONTH = SD_MDY2;  
c)  DA1 /DAY   = SD_MDY2;  
d)  QT1 /Q     = SD_MDY2;  
e)  WK1 /W     = SD_MDY2;  

Alternately, you may use the DPART function:
  a)  YR1 /YY    = DPART(SD_MDY2,'YEAR'   ,YR1);  
  b)  MO1 /MONTH = DPART(SD_MDY2,'MONTH'  ,MO1);  
  c)  DA1 /DAY   = DPART(SD_MDY2,'DAY'    ,DA1);  
  d)  QT1 /Q     = DPART(SD_MDY2,'QUARTER',QT1);  
  e)  YR2 /I4    = DPART(SD_MDY2,'YY',    'I4');  
  f)  MO2 /I2    = DPART(SD_MDY2,'MM',    'I2');  
  g)  DA2 /I2    = DPART(SD_MDY2,'DAY',   'I2');  
  h)  QT2 /I2    = DPART(SD_MDY2,'QQ',    'I2');  

This and more can be found in the "Dates Book" available at www.Aviter.com".

This message has been edited. Last edited by: John W Price,



WebFOCUS 8.0.2, FOCUS since 1977 - John@Aviter.com
PDF , Excel, FOCUS, Author of the Keysheets and Dates book.
www.Aviter.com
 
Posts: 40 | Registered: April 19, 2013Report This Post
Master
posted Hide Post
thanks.. I will try...


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Expert
posted Hide Post
Several ways to do this:

DEFINE FILE CAR
TEST_DATE/MDYY = '03232011';
END

TABLE FILE CAR
PRINT
TEST_DATE
COMPUTE TEST_MONTH_I/I2 = DPART(TEST_DATE,'MM',    'I2'); 
COMPUTE TEST_MONTH_A/A02 = EDIT(FPRINT(TEST_DATE,'MDYY','A10'),'99$');
BY COUNTRY
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
Expert
posted Hide Post
DATECVT?
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Master
posted Hide Post
Thanks all, when we get our server back I'll give it a go....


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Expert
posted Hide Post
The simplest way is to DEFINE or COMPUTE a field with a format of D

TABLE FILE CAR
PRINT COMPUTE DATE_MDYY/MDYY = '07/31/2013' ;
COMPUTE DATE_DAY/D = DATE_MDYY ;
COMPUTE DAY_I2/I2 = DATE_DAY ;
COMPUTE DAY_A2/A2 = EDIT(DATE_DAY);

BY COUNTRY NOPRINT
WHERE RECORDLIMIT EQ 1
END


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Master
posted Hide Post
Cripes, Waz ... Please don't tell me they use that idiotic MDYY format down under ....


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report This Post
Expert
posted Hide Post
No, Never.......

Smiler


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
I'm in the middle here, but, what's wrong with the MDYY format?
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Expert
posted Hide Post
quote:
what's wrong with the MDYY format


Can O worms ......

Big Grin


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Master
posted Hide Post
quote:
Originally posted by Waz:
quote:
what's wrong with the MDYY format


Can O worms ......

Big Grin


Except all of my users like dates displayed in mm/dd/yyyy format.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Expert
posted Hide Post
quote:
all of my users like dates displayed in mm/dd/yyyy format

Store them as smart dates with usage format = mm/dd/yyyy. BTW: I like that format for display, not for storage or sorting. Fortunately, WebFOCUS has those two options in its Can O Worms.
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Expert
posted Hide Post
quote:
all of my users like dates displayed in mm/dd/yyyy format


Well there you go, different "regions" like different formats.

In OZ its either YYYY/MM/DD or DD/MM/YYYY.

And other countries around the world its different again.

Thank be to the Smart Date gods.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Master
posted Hide Post
Just wanted to thank you all...COMPUTE DATE_DAY/D = DATE_MDYY ;
is working.


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Expert
posted Hide Post
Please edit your first post in this thread and add [SOLVED] to the title.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report 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] CONVERSION OF MDYY filed

Copyright © 1996-2020 Information Builders