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. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Converting a MDYY field to a Year - Month (2019-Jul)

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Converting a MDYY field to a Year - Month (2019-Jul)
 Login/Join
 
Member
posted
I have a date field that returns in a by statement as 07/01/2019 I need to convert it to say 2019-July. The database field is defined as a MDYY.

This message has been edited. Last edited by: FP Mod Chuck,


8201
 
Posts: 17 | Registered: April 20, 2018Report This Post
Virtuoso
posted Hide Post
YOURDATEFIELD/YYMtr=OLDDATEFIELD;


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Expert
posted Hide Post
This is well documented, and has been asked many times in the past, with many solutions.


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: 6349 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Member
posted Hide Post
quote:
YOURDATEFIELD/YYMtr=OLDDATEFIELD;

That does not work. I am trying to convert it to alpha. I have to join two tables one is MTR format and the other is YYMDy format. I have search the focal point and the online dictionary with no results


8201
 
Posts: 17 | Registered: April 20, 2018Report This Post
Platinum Member
posted Hide Post
sherrihe,
If you make both date fields the same format it should work. If it still doesn't, the problem may not be with the field formats but with the file formats. Are both files you are joining the same format (FOC, SQL, etc)?


WebFOCUS 8.2.03 (production), 8.2.06 (testing)
AppStudio, InfoAssist
Windows, All Outputs
 
Posts: 183 | Location: Indiana | Registered: December 05, 2017Report This Post
Guru
posted Hide Post
If you need it in alpha then FPRINT is your friend

DEFINE FILE TRADES
DATE_ONE/YYMtr=DATE_OF_TRADE;
DATE_TWO/A25V=FPRINT(DATE_ONE, 'YYMtr', DATE_TWO);
DATE_THREE/A25V=REPLACE(DATE_TWO, ', ', '-');
END

Not sure if REPLACE is available in 8201, if not then you can use STRREP

Cheers

Stu


WebFOCUS 8.2.03 (8.2.06 in testing)
 
Posts: 253 | Location: Melbourne, Australia | Registered: February 07, 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     [SOLVED] Converting a MDYY field to a Year - Month (2019-Jul)

Copyright © 1996-2020 Information Builders