[SOLVED] Convert SMRTDATE/M to A9 full month word?
Is there a function on WF that will take a Smart Date formated field that is a format of "Mtr" and put the fullword of the month into an A9 alpha field?
Don't ask me why I wnat to do this because it would take too long to explain what I am doing. I am neck deep into a complicated but really cool report program.
This message has been edited. Last edited by: <Kathryn Henning>,
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
September 13, 2007, 05:19 PM
Francis Mariani
Wishful thinking!
I've found that we have to use DEFINE or COMPUTE. Here, I've typed it out for you, so you don't have to
MTR/A9 = DECODE MX (
01 January , 02 February, 03 March , 04 April
05 May , 06 June , 07 July , 08 August
09 September, 10 October , 11 November, 12 December ELSE '');
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
September 13, 2007, 05:23 PM
mgrackin
Thanks Francis for the thoughtfulness. However, I already coded the whole thing before I posted my question. I was just wondering if there was a simplier way. Apparently we need 1002 ways to work with dates in WF.
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
September 13, 2007, 05:28 PM
Francis Mariani
Spoke too soon!
TABLE FILE GGORDER
SUM
ORDER_DATE NOPRINT
COMPUTE ORDER_DATEA/A8YYMD = ORDER_DATE;
COMPUTE ORDER_MTR/A17 = CHGDAT('YYMD','MX',ORDER_DATEA,'A17') ;
BY ORDER_DATE NOPRINT
WHERE READLIMIT EQ 10
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
September 13, 2007, 05:39 PM
Francis Mariani
Or
TABLE FILE GGORDER
SUM
ORDER_DATE NOPRINT
COMPUTE ORDER_DATEA/A8YYMD = ORDER_DATE;
COMPUTE ORDER_MTR/A9 = LCWORD(9, CHGDAT('YYMD','MX',ORDER_DATEA,'A9'), 'A9');
BY ORDER_DATE NOPRINT
WHERE READLIMIT EQ 10
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
September 13, 2007, 05:49 PM
Prarie
Very Good
In Focus since 1993. WebFOCUS 7.7.03 Win 2003
September 13, 2007, 06:07 PM
susannah
indeed!
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
September 14, 2007, 02:24 AM
Tony A
Busy are you Francis? lol
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
September 14, 2007, 12:35 PM
mgrackin
Thanks Francis. I'll give that a try. It looks good. I will also look it up in the manual. Yikes!
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
September 14, 2007, 02:07 PM
Glenda
Here's just one more way.
TABLE FILE GGORDER SUM ORDER_DATE NOPRINT COMPUTE ORDER_LOWER/MONtr = ORDER_DATE; COMPUTE ORDER_UPPER/MONTR = ORDER_DATE; BY ORDER_DATE NOPRINT WHERE READLIMIT EQ 10 END
Glenda
In FOCUS Since 1990 Production 8.2 Windows
September 15, 2007, 12:06 PM
susannah
slick! that's got uses for alot of stuff i am currently doing the old fashioned way... thanks for reading the manual for us, Glenda.
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
September 16, 2007, 10:45 PM
j.gross
quote:
Originally posted by Francis Mariani: -snip- COMPUTE ORDER_MTR/A9 = LCWORD(9, CHGDAT('YYMD','MX',ORDER_DATEA,'A9'), 'A9'); [/code]
I always give CHGDAT a full 'A17' output to work with; when you give it A9, no telling what the additional A6 it returns may trounce.
- Jack Gross WF through 8.1.05
September 17, 2007, 11:15 AM
mgrackin
My original requirement was for the Month Name to be in an ALPHA format field. Glenda's technique works great but does not put the month name into and alpha field.
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
September 17, 2007, 11:40 AM
Francis Mariani
quote:
MONTR
Where's this curious format in the manual?
Tony, I have reports that take a half hour to run due to DBA's not having indexes on the DB2 tables, hence I have a lot of time...
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