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     Convert Alphanumeric to a date time format

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Convert Alphanumeric to a date time format
 Login/Join
 
Platinum Member
posted
Hello,
How do I go about converting a alphanumeric date to a datetime format? Example: July 03 2006 1:27PM to 07/03/2006 13:27.

I tried using the HINPUT function but received this error back:
0 ERROR AT OR NEAR LINE 15 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC003) THE FIELDNAME IS NOT RECOGNIZED: July
BYPASSING TO END OF COMMAND
(FOC009) INCOMPLETE REQUEST STATEMENT

Thanks in advance.


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
 
Posts: 121 | Registered: November 17, 2005Report This Post
Virtuoso
posted Hide Post
Look at this post

https://forums.informationbuilders.com/eve/forums/a/tpc/...1057331/m/1711086371


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Platinum Member
posted Hide Post
Example:

 -* "July 03 2006 1:27PM" string to 07/03/2006 13:27 date/time
DEFINE FILE CAR
  DATEA/A20    = 'July 03 2006 1:27PM' ;
  DATEH/HDMYYS = HINPUT(20, DATEA, 8, 'HDMYYS'); 
END

TABLE FILE CAR
  PRINT DATEA DATEH COUNTRY NOPRINT
END

Doc. Ref.:

HINPUT: Converting an Alphanumeric String to a Timestamp
Date and Time Components For Date and Date-Time Functions

Regards,
Mikel


WebFOCUS 8.1.05, 8.2.01
 
Posts: 173 | Location: Madrid, Spain | Registered: May 09, 2003Report This Post
Platinum Member
posted Hide Post
Date1/A20='OrigRDD';
Date2/HYYMDS=HINPUT(14,'OrigRDD', 20, 'HYYMDS');
Date3/MDYY=HDATE(Date2,'MDYY');

Here is the code that I'm using. The problem is that when I open the report in developers studio these fields are not there for me to insert into the report. I manually go into the text view of the report and type Date1 in and then run the report but no data comes back. What comes back for Date1 is text saying OrigRDD.

Besides converting the date I also need to concatenate OrigRDD and OrigDD2 together so it would look like OrigDD - OrigDD2.

What am I doing wrong?

Thanks in advance.


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
 
Posts: 121 | Registered: November 17, 2005Report This Post
Virtuoso
posted Hide Post
In Date1 take the ' ' off. It is reading that as a test field OrigRDD.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Platinum Member
posted Hide Post
If I take the quotes off then I get this error message:
(FOC282) RESULT OF EXPRESSION IS NOT COMPATIBLE WITH THE FORMAT OF FIELD: DATE1


Prod: WebFOCUS 8.2.0.4
OS: Windows
Outputs: HTML, PDF, Excel, PPT
In Focus since 2005
 
Posts: 121 | Registered: November 17, 2005Report This Post
Master
posted Hide Post
Try this,

TABLE FILE TEST
PRINT
OrigRDD AS 'ORIGRDD'
ON TABLE HOLD AS TEST1
ON TABLE SET ASNAMES ON
END
-RUN

DEFINE FILE TEST1
DATE1/A20=ORIGRDD;
DATE2/HYYMDS=HINPUT(14,DATE1, 20, 'HYYMDS');
DATE3/MDYY=HDATE(DATE2,'MDYY');
END

TABLE FILE TEST1
PRINT ORIGRDD DATE1 DATE2 DATE3
END
-EXIT


WFConsultant

WF 8105M on Win7/Tomcat
 
Posts: 780 | Location: Florida | Registered: January 09, 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     Convert Alphanumeric to a date time format

Copyright © 1996-2020 Information Builders