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] Show Month and Year from today's date

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Show Month and Year from today's date
 Login/Join
 
Gold member
posted
I'm trying to use the "SET-" operation to take today's date (in the &YYMD format) and have it show up with just the Month and 4-digit year (ie Sep 2018).

With a million combinations of date formats, I can't quite figure out which ones will make it show up correctly.

Using v8.1.05

Any suggestions?

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



WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 67 | Registered: May 21, 2014Report This Post
Virtuoso
posted Hide Post
  
-SET &CMONTHYYM=EDIT(&YYMD,'999999');
-TYPE &CMONTHYYM


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Platinum Member
posted Hide Post
One way ...

-SET &T1_MYY  = EDIT(FPRINT(DATECVT(&YYMD,'I8YYMD','MYY'),'MtYY','A09'),'999$99999');
-TYPE ----------------------
-TYPE YYMD -------- &YYMD
-TYPE T1_MYY ------ &T1_MYY
-TYPE ----------------------  


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Gold member
posted Hide Post
Thanks BabaNYC. Looks like that gets me to '201809', but I'm looking for 'Sep 2018'.

Did I not do something correctly?



WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 67 | Registered: May 21, 2014Report This Post
Gold member
posted Hide Post
quote:
Originally posted by jfr99:
One way ...

-SET &T1_MYY  = EDIT(FPRINT(DATECVT(&YYMD,'I8YYMD','MYY'),'MtYY','A09'),'999$99999');
-TYPE ----------------------
-TYPE YYMD -------- &YYMD
-TYPE T1_MYY ------ &T1_MYY
-TYPE ----------------------  

I think I can get that to work. Thanks!!



WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 67 | Registered: May 21, 2014Report This Post
Virtuoso
posted Hide Post
I'm wondering why you need this format in a Variable. Will you be using it in a report as a parameter?


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Platinum Member
posted Hide Post
A couple other ways ...

-TYPE -----------------------
-TYPE YYMD -------- &YYMD
-TYPE DATEMt ------ &DATEMt
-TYPE DATEYY ------ &DATEYY
-TYPE DATEMtYY ---- &DATEMtYY
-TYPE -----------------------
-SET &T1_MYY  = EDIT(FPRINT(DATECVT(&YYMD,'I8YYMD','MYY'),'MtYY','A09'),'999$99999');
-TYPE T1_MYY ------ &T1_MYY
-TYPE -----------------------
-SET &T2_MYY  = EDIT(&DATEMtYY.QUOTEDSTRING,'999$99999');
-TYPE T2_MYY ------ &T2_MYY
-TYPE -----------------------
-SET &T3_MYY  = &DATEMt | ' ' | &DATEYY;
-TYPE T3_MYY ------ &T3_MYY
-TYPE -----------------------
-SET &T4_MYY  = '&DATEMt.EVAL &DATEYY.EVAL';
-TYPE T4_MYY ------ &T4_MYY
-TYPE -----------------------


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Virtuoso
posted Hide Post
I'm still not sure what the use case is for these contortions. There are plenty of ways to get these formats with DEFINE and TABLE but I'm at a loss why one needs an &VARIABLE that has these values.

Just saying!


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Expert
posted Hide Post
quote:
I'm at a loss why one needs an &VARIABLE that has these values


From my experience, the longer you've been in the business, the more you find the need for these "obscure" variables.

My guess is that an important customer has asked for it.


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
Virtuoso
posted Hide Post
My point is there are many ways to display different date formats in a report. The point of populating an &Variable with a value is to use it in a WHERE test or pass it to a drill down report. In either case, having an &Variable set to SEP 2018 doesn't seem to help with a WHERE test. That's why I'm wondering what other use is there in having that value in an &Var.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report This Post
Expert
posted Hide Post
quote:
what other use is there

Display as in a heading?

Don't forget that there are &DATEDMYY, &DATEDMtrYY and the various alternatives. Give the option and it will be used!!

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 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Gold member
posted Hide Post
quote:
Originally posted by BabakNYC:
I'm wondering why you need this format in a Variable. Will you be using it in a report as a parameter?

Using as a dynamic column heading on a year-over-year revenue report. First column is this month (Sep 2018), second column is same month last year (Sep 2017), etc.

-SET &T1_MYY  = EDIT(FPRINT(DATECVT(&YYMD,'I8YYMD','MYY'),'MtYY','A09'),'999$99999');

TABLE FILE YOYREVENUE
PRINT
	 TOTAL_SALES AS '&T1_MYY'  



WebFOCUS 8.1.05
Windows, All Outputs
 
Posts: 67 | Registered: May 21, 2014Report This Post
Virtuoso
posted Hide Post
Thank you that makes sense.


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report 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] Show Month and Year from today's date

Copyright © 1996-2020 Information Builders