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] Date Format issue

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Date Format issue
 Login/Join
 
Platinum Member
posted
Hello,

I'm trying to prefill a combo box with dates from a sql stored proc. I would like the dates to display as MDYY in the drop down box. I tried this:
 NEWDATE/YYMD=HDATE(LD,'YYMD');
NEWDATE2/MDYY=NEWDATE; 
and kept getting an error :

0 NUMBER OF RECORDS IN TABLE= 36 LINES= 36
0 ERROR AT OR NEAR LINE 12 IN PROCEDURE month.fexFOCEXEC *
(FOC282) RESULT OF EXPRESSION IS NOT COMPATIBLE WITH THE FORMAT OF FIELD:
NEWDATE2
0 ERROR AT OR NEAR LINE 16 IN PROCEDURE month FOCEXEC *
(FOC003) THE FIELDNAME IS NOT RECOGNIZED: NEWDATE2
BYPASSING TO END OF COMMAND
(FOC009) INCOMPLETE REQUEST STATEMENT

How do I fix this? Thanks for any help.

This message has been edited. Last edited by: Kerry,


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
Expert
posted Hide Post
Works for me.

DEFINE FILE CAR
LD/HYYMDS = HINPUT(14, '20090509000000', 8, 'HYYMDS');
NEWDATE/YYMD=HDATE(LD,'YYMD');
NEWDATE2/MDYY=NEWDATE;
END
TABLE FILE CAR
PRINT
NEWDATE
NEWDATE2
BY COUNTRY
-*ON TABLE PCHOLD FORMAT XML
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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
My HTML launch page has two amper variable dates. &dte and &edte. The request is to have a starting period and ending period. The data source (store proc) from sql server has one datefield - Report Date field with two amper dates off this field. The Report Date comes over to focus formatted as HYYMDS - last date of month. So to make it easier on the launch page, I created another stored proc off the same data source with distinct date to prefill the two date fields. The XML focus procedure will only allow this format: NEWDATE/YYMD=HDATE(LD,'YYMD');
Once I converted the first format to NEWDATE2/MDYY=NEWDATE;
and ran the report it screamed the varchar error at me..I'm confused...I can run the XML separately just as Frank did with no problems..but once you want to use it on your launch page with addional date formatting it does not work.


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
Member
posted Hide Post
Hello Joe;

create a fex with an xml output to load you combobox.

convert your date from sql to return something like 01/01/2011 string nvarchar(10) usually.

here is the format to return the date that way.

CONVERT(NVARCHAR(10),getdate(), 0),101)

the date will be 01/27/2011 that it will return.

substitue the getdate() function for the field that you need and that will give you your xml tag to load into the combobox.


WebFocus 7.6.10, Windows XP.
 
Posts: 4 | Registered: November 16, 2010Report This Post
Expert
posted Hide Post
JOE, ensure that your external fex that retrieves and manipulates the dates only outputs two columns of data in the XML file.

DEFINE FILE CAR
LD/HYYMDS = HINPUT(14, '20090509000000', 8, 'HYYMDS');
NEWDATE/YYMD=HDATE(LD,'YYMD');
NEWDATE2/MDYY=NEWDATE;
END
TABLE FILE CAR
PRINT
NEWDATE NOPRINT
NEWDATE2
BY COUNTRY
ON TABLE PCHOLD FORMAT XML
ON TABLE SET HOLDLIST PRINTONLY
END

NOPRINT (if required) and HOLDLIST are key here...


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
Platinum Member
posted Hide Post
Ah!!ML..That worked! I see now. I never thought of converting my sql stored proc date job to varchar. Thanks! Only problem I see with this is that the dates do not go in date order.


WebFocus 7.7.02 WinXP
 
Posts: 236 | Registered: May 12, 2006Report This Post
Expert
posted Hide Post
Just add an order by phrase in the SQL of your stored procedure - use the original date field, not the converted one.


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
  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] Date Format issue

Copyright © 1996-2020 Information Builders