Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Converting a MDYY field to a Year - Month (2019-Jul)
Go
New
Search
Notify
Tools
Reply
  
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.


8201
 
Posts: 16 | Registered: April 20, 2018Reply With QuoteReport This Post
Virtuoso
posted Hide Post
YOURDATEFIELD/YYMtr=OLDDATEFIELD;


WebFOCUS 8206, Unix, Windows
 
Posts: 1743 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport 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.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6167 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport 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: 16 | Registered: April 20, 2018Reply With QuoteReport 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: 146 | Location: Indiana | Registered: December 05, 2017Reply With QuoteReport This Post
Platinum Member
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: 244 | Location: Melbourne, Australia | Registered: February 07, 2007Reply With QuoteReport This Post
  Powered by Social Strata  
 

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

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.