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     ***CLOSED Easiest way to Convert a Date

Read-Only Read-Only Topic
Go
Search
Notify
Tools
***CLOSED Easiest way to Convert a Date
 Login/Join
 
Master
posted
We have a field called service_date. It prints like this:

2015/04/26 00:00:00.000

...not very appealing. We'd prefer 04/26/2014.

When I hover over the field it says its type is: Real and format is: HYYMDs.

I thought I could change the usage to DMY or MDY...no luck it throws an error:

(FOC1418) ACTUAL/USAGE TYPE MISMATCH FOR DATETIME FIELD.

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


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Guru
posted Hide Post
If your using SQL to pull your data, you can use something like this

 
CAST (DATE_TIME AS CHAR(10)) AS DATE
 


OR in a DEFINE


 
DATE/A10    = HCNVRT(DATE1, '(HYYMD)', 20, 'A10');

 


Then you can manipulate further if you want it changed to show MM/DD/YYY.

I am sure there are dozen other ways.


WebFOCUS 8.1.05
 
Posts: 496 | Registered: January 04, 2008Report This Post
Master
posted Hide Post
hmmm...I tried this:
DOS/A10=HCNVRT(PB_TRANSACTION_CHARGES_VW.PB_TRANSACTION_CHARGES_VW.SERVICE_DATE, '(HYYMD)', 10, 'A10');

I get this error:
FOC2590 - AGGREGATION NOT DONE FOR THE FOLLOWING REASON:
FOC2565 - THE OBJECT OF BY/ACROSS CANNOT BE CONVERTED TO SQL
FOC2566 - DEFINE DOS CANNOT BE CONVERTED TO SQL
FOC2567 - FUNCTION HCNVRT CANNOT BE CONVERTED TO SQL


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Virtuoso
posted Hide Post
http://infocenter.informationb...rce%2Fdatetime14.htm

Use HDATE()


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Guru
posted Hide Post
Try this

PRINT_DATE/HMDYY=PB_TRANSACTION_CHARGES_VW.PB_TRANSACTION_CHARGES_VW.SERVICE_DATE;


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
 
Posts: 398 | Registered: February 04, 2008Report This Post
Master
posted Hide Post
quote:
PRINT_DATE/HMDYY=PB_TRANSACTION_CHARGES_VW.PB_TRANSACTION_CHARGES_VW.SERVICE_DATE;



yeilds this: FOC2590 - AGGREGATION NOT DONE FOR THE FOLLOWING REASON:
FOC2565 - THE OBJECT OF BY/ACROSS CANNOT BE CONVERTED TO SQL
FOC2566 - DEFINE PRINT_DATE CANNOT BE CONVERTED TO SQL
FOC2584 - CANNOT IMPLICITLY CONVERT VALUE OF FIELD SERVICE_DATE TO USAGE HMDYY


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Master
posted Hide Post
fyi..here is soe of the code..

DEFINE FILE PB_TRANSACTION_CHARGES_VW
LOCATIONGROUP/A10=IF J3.POS_VW.FACILITY_TYPE__CODE EQ 11 THEN 'OFFICE' ELSE 'OTHER';
PRINT_DATE/HMDYY=PB_TRANSACTION_CHARGES_VW.PB_TRANSACTION_CHARGES_VW.SERVICE_DATE;
END
TABLE FILE PB_TRANSACTION_CHARGES_VW
SUM
PB_TRANSACTION_CHARGES_VW.PB_TRANSACTION_CHARGES_VW.PROCEDURE_QUANTITY AS 'Units'
PB_TRANSACTION_CHARGES_VW.PB_TRANSACTION_CHARGES_VW.RVU_WORK AS 'wRVUs'
BY LOWEST PB_TRANSACTION_CHARGES_VW.PB_TRANSACTION_CHARGES_VW.PERIOD_OF_POST_DATE
BY LOWEST J1.PROVIDER_VW.SUI
BY LOWEST J1.PROVIDER_VW.PROVIDER_NAME
BY LOWEST J3.POS_VW.LOCATIONGROUP
BY LOWEST J2.BILL_AREA_VW.BILL_AREA_NUM AS 'CC'
BY LOWEST PB_TRANSACTION_CHARGES_VW.PB_TRANSACTION_CHARGES_VW.PATIENT_NAME
BY LOWEST PB_TRANSACTION_CHARGES_VW.PB_TRANSACTION_CHARGES_VW.SERVICE_DATE
BY LOWEST J0.CPT_CODE_VW.CPT_CODE AS 'Cpt'
BY LOWEST J0.CPT_CODE_VW.CPT_NAME AS 'Cpt Name'
WHERE


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Virtuoso
posted Hide Post
Will a simple reformatting work?

DEFINE FILE PB_TRANSACTION_CHARGES_VW
 LOCATIONGROUP/A10 = IF J3.POS_VW.FACILITY_TYPE__CODE EQ 11 THEN 'OFFICE' ELSE 'OTHER';
END
-*
TABLE FILE PB_TRANSACTION_CHARGES_VW
 SUM
  PB_TRANSACTION_CHARGES_VW.SERVICE_DATE/HMDYY
  PB_TRANSACTION_CHARGES_VW.PB_TRANSACTION_CHARGES_VW.PROCEDURE_QUANTITY AS 'Units'
  PB_TRANSACTION_CHARGES_VW.PB_TRANSACTION_CHARGES_VW.RVU_WORK AS 'wRVUs'
 BY  LOWEST PB_TRANSACTION_CHARGES_VW.PB_TRANSACTION_CHARGES_VW.PERIOD_OF_POST_DATE
 BY  LOWEST J1.PROVIDER_VW.SUI
 BY  LOWEST J1.PROVIDER_VW.PROVIDER_NAME
 BY  LOWEST LOCATIONGROUP
 BY  LOWEST J2.BILL_AREA_VW.BILL_AREA_NUM AS 'CC'
 BY  LOWEST PB_TRANSACTION_CHARGES_VW.PB_TRANSACTION_CHARGES_VW.PATIENT_NAME
 BY  LOWEST PB_TRANSACTION_CHARGES_VW.PB_TRANSACTION_CHARGES_VW.SERVICE_DATE
 BY  LOWEST J0.CPT_CODE_VW.CPT_CODE AS 'Cpt'
 BY  LOWEST J0.CPT_CODE_VW.CPT_NAME AS 'Cpt Name'
 WHERE...


WebFOCUS 7.7.05
 
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007Report This Post
Platinum Member
posted Hide Post
Example using the CAR file ...

-*
-TYPE +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-TYPE +++ SET CURRENT EXTRACT DTS +++
-TYPE +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-SET &CUR_DTS = &DATEYYMD | EDIT (&TOD, ' 99$:99$:99');
-TYPE ---------------------------------------------------------
-TYPE CUR_DTS ---------- &CUR_DTS
-TYPE ---------------------------------------------------------
-RUN
-*-EXIT
-*
DEFINE FILE CAR
DATE1/HYYMDs = DT(2015/04/26 00:00:00);
DATE2/MDYY = HDATE(DATE1, 'MDYY');
-*
CUR_DATE1/HYYMDs = DT(&CUR_DTS);
CUR_DATE2/MDYY = HDATE(CUR_DATE1, 'MDYY');
END
-*
TABLE FILE CAR
PRINT
DATE1
DATE2
-*
CUR_DATE1
CUR_DATE2
BY COUNTRY
END


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Expert
posted Hide Post
I think HDATE is the way to go, it extracts the date portion of the date time stamp.

Another option if the time is never needed, is to change the master from HYYMDs to YYMD


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
Master
posted Hide Post
I will look at HDATE.

Waz,
What do I change in the master file? Usage? Under Usage, Type? I tried changing that from HYYMDs to YYMD. The fex then throws the type mismatch error.

This master file is against a view that was set up for us...not sure if that is factoring in...

Maybe the HDATE thing will work...I wish I could just right click the field in the GUI and pick the format I want...


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Expert
posted Hide Post
quote:
Another option if the time is never needed, is to change the master from HYYMDs to YYMD

I very often do this for RDBMS synonyms if only Date is required without time.

I duplicate the datetime row in the synonym like this -
FIELDNAME=service_date, ALIAS=service_date, USAGE=HYYMDS, ACTUAL=HYYMDS, $
FIELDNAME=service_yymd, ALIAS=service_date, USAGE=YYMD, ACTUAL=DATE, $

Note that the ALIAS MUST always relate the actual column name in the RDBMS. If you want an internal date format then the ACTUAL needs to be changed to DATE with the USAGE reflecting the format that you want used in your report.

This normally converts to SQL just fine.

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
Expert
posted Hide Post




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
Expert
posted Hide Post
Nice,



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
Expert
posted Hide Post
quote:
I am sure there are dozen other ways.

There's a good reference book: "(Almost) 1001 Ways to Work With DATES in WEBFOCUS"... Check it out...
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Master
posted Hide Post
here is what turned out to work...Jeeeez!


DOS/A20 = EDIT(DATECVT(HDATE( PB_TRANSACTION_CHARGES_VW.PB_TRANSACTION_CHARGES_VW.SERVICE_DATE , 'MDYY'),'MDYY','A8MDYY'),'99/99/9999')


WebFOCUS 8206.08
Windows, All Outputs
 
Posts: 603 | Registered: June 28, 2013Report This Post
Master
posted Hide Post
quote:
We have a field called service_date. It prints like this:

2015/04/26 00:00:00.000

...not very appealing. We'd prefer 04/26/2014.

I just saw this post and even though it's closed, I'll add my 2 cents worth.

Although the empty timestamp is obviously redundant the date format IMHO is the only one worth considering and using.

1) It is the only format where dates will sort automatically even in alphanumerc format

2) There is no confusion about what is the month or the day

3) It is the internationally accepted SI format.

Here in Canada things are moving at a glacial pace towards acceptance of the SI format (blank cheques issued by all the banks require the date to be entered in SI format, for example). Some businesses uses DD/MM/YYYY and others (mostly American subsidiaries) use MM/DD/YYYY. Of all the different formats MM/DD/YYYY is the least defensible as far as I'm concerned.


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
 
Posts: 674 | Location: Guelph, Ontario, Canada ... In Focus since 1985 | Registered: September 28, 2010Report This Post
Expert
posted Hide Post
quote:
Of all the different formats MM/DD/YYYY is the least defensible as far as I'm concerned.

Good One

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
Expert
posted Hide Post
Ditto

Music


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
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     ***CLOSED Easiest way to Convert a Date

Copyright © 1996-2020 Information Builders