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     Date format in heading not printing properly

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Date format in heading not printing properly
 Login/Join
 
Member
posted
I am trying to print the date used as a report input parameter to the report title but to display it in a different format. I am current prompting for START_DT whose date format is YYMD (ie: 20060930). When I add this to the heading title for display as &START_DT, it displays fine as 20060930. I want to display is as 09/30/2006.

I have added a define to change the format of the prompt field:

df_START_DT/MDYY = &START_DT

The code for the heading is as follows:

HEADING
"Billing Account Report"
"PO Nbr : &PO_NBR , Vendor : "Date Range From : &Start_DT

When I run it a get the error: INVALID DATE CONSTANT.

I've tried other formats but get similiar results. What am I doing wrong?
 
Posts: 25 | Registered: March 15, 2006Report This Post
Expert
posted Hide Post
Guillo, you've got to convert it first.
It starts life as a characterstring.
you have to convert it from a character string to a smart date.
You can use the DATECVT function if you like, it works fine in DM.
There are a lot of other ways




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Member
posted Hide Post
Susannah, thank you for the quick response.

I've tried the following format on the DEFINE:

df_Start_DT/MDYY = DATECVT(&Start_DT,YYMD,MDYY);

But after running it I get:

(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: YYMD

Is the input format for the DATECVT function the right one?
 
Posts: 25 | Registered: March 15, 2006Report This Post
Expert
posted Hide Post
Syntax:

DATECVT(date, 'infmt', 'outfmt');


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
Member
posted Hide Post
I believe that I've used the format as you've indicated. I guess what I'm asking is, is the standard form for dates actually YYMD since what is displayed and entered in the prompt is in the form of: 20061001 (YYMD)?
 
Posts: 25 | Registered: March 15, 2006Report This Post
Silver Member
posted Hide Post
-SET &START_DT ='20060906';
DEFINE FILE CAR
DF_START_DX/YYMD = DATECVT(&START_DT,'I8YYMD','YYMD');
DF_START_DT/MDYY = DATECVT('&START_DT','A8YYMD','MDYY');
END
TABLE FILE CAR
PRINT DF_START_DT
DF_START_DX
BY COUNTRY
END

The quotes around the in and out are required and since &start_dt is not really YYMD you need I8 or A8 and quotes as needed.

Sandy
 
Posts: 38 | Location: Chicago, IL area | Registered: June 16, 2004Report This Post
Expert
posted Hide Post
nuance...format YYMD indicates a 'smart date'
a smart date is an integer , the number days elapsed since the beginning of the last millenium, its a number on the order of 38000.
Your &var date is most likely 20060517
which isn't YYMD, its I8YYMD, even tho it might look like YYMD, it isn't.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Platinum Member
posted Hide Post
DM "thinks" in alpha or numeric only. You can define a smart date field directly from a DM variable. I think yours didn't work because you tried to drop &START_DT into a MDYY and 20 is not a valid month.

Although you've been given a solution, I wanted to post about why your initial approach didn't work. You could have tweaked it as follows:
-SET &VAR1 = 20060930;
DEFINE FILE CAR
DATE1/YYMD = &VAR1;
DATE2/MDYY = DATE1;
-* or if you want to do it in one step...
DATE3/MDYY =
EDIT(EDIT('&VAR1','$$$$99') | EDIT('&VAR1','$$$$$$99') | EDIT('&VAR1','9999'));
END
-*
TABLE FILE CAR
HEADING
"DATE2: "DATE3: PRINT COUNTRY
END
Always a bunch of ways to do stuff in FOCUS....
 
Posts: 118 | Location: DC | Registered: May 13, 2005Report This Post
<Aparna>
posted
quote:
Originally posted by Guillo:
I am trying to print the date used as a report input parameter to the report title but to display it in a different format. I am current prompting for START_DT whose date format is YYMD (ie: 20060930). When I add this to the heading title for display as &START_DT, it displays fine as 20060930. I want to display is as 09/30/2006.

I have added a define to change the format of the prompt field:

df_START_DT/MDYY = &START_DT

The code for the heading is as follows:

HEADING
"Billing Account Report"
"PO Nbr : &PO_NBR , Vendor : "Date Range From : &Start_DT

When I run it a get the error: INVALID DATE CONSTANT.

I've tried other formats but get similiar results. What am I doing wrong?



is &START_DT an input field then you need to user it as
df_START_DT/MDYY = '&START_DT';

one minor change. put &START_DT in single quotes
 
Report This Post
Member
posted Hide Post
Thank you all for your responses.

I applied the approach that Sandy suggested and it worked beautifully. I only had to add the DEFINE statements as follows:

df_Start_DT/MDYY = DATECVT('&Start_DT','A8YYMD','MDYY');
df_End_DT/MDYY = DATECVT('&End_DT','A8YYMD','MDYY');

The final results printed, which is what I was after, was:

Date Range From : 10/01/2005 To : 09/29/2006

This approach seemed simple to apply with good results.
 
Posts: 25 | Registered: March 15, 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     Date format in heading not printing properly

Copyright © 1996-2020 Information Builders