Focal Point
[SOLVED] TIME and Date to Date only

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/318106324

April 20, 2010, 01:16 PM
Arif
[SOLVED] TIME and Date to Date only
How do I convert date and time column to only date column

My date looks like this 2002-12-26 00:00:00.000
What function can I use to make it look like this 2002-12-26

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


WebFOCUS 7.6.10
Windows
HTML
April 20, 2010, 01:19 PM
GinnyJakes
Please check the "Using Function" manual and the search capability on this forum for the subroutine HDATE which converts the date portion of a datetime stamp to a date.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
April 20, 2010, 01:29 PM
webFocus_reporter
convert your field date data type- select "none" for time part


WebFOCUS 7.6.X/7.7.X
Windows
all output
April 20, 2010, 02:04 PM
Francis Mariani
quote:
"none"
?


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
April 20, 2010, 02:24 PM
Arif
It works to show the date on the reprot, but when I want to use this date for period calculations, my calulations dont work with formate change in dev studio.


WebFOCUS 7.6.10
Windows
HTML
April 20, 2010, 02:44 PM
GinnyJakes
Please see my previous post. Use the HDATE function.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
April 20, 2010, 02:58 PM
Arif
I am getting results in integers for the following HDATE. Its not bring the date back.
HDATE(STAGE_CHILD_POS.STAGE_CHILD_POS.SCHOOLOPENDATE, 'YYMD')


WebFOCUS 7.6.10
Windows
HTML
April 20, 2010, 03:05 PM
Francis Mariani
Though your "date looks like this 2002-12-26 00:00:00.000", the format of the field is more important. What is the format for field SCHOOLOPENDATE in the Master for table STAGE_CHILD_POS?


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
April 20, 2010, 03:11 PM
Arif
Formate of my field is datetime. Its coming from SQL 2008 server.


WebFOCUS 7.6.10
Windows
HTML
April 20, 2010, 04:01 PM
njsden
Can you post the exact piece of code where you're making the transformation using HDATE? It would also be helpful to see the FIELD definition of SCHOOLOPENDATE as it appears in your masterfile.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
April 20, 2010, 04:50 PM
jimster06
This being an H format date, why not assign it to an HYYMD formatted field for display?

TABLE FILE WHATEVER
PRINT
SCHOOLOPENDATE/HYYMD
etc

edited to add:
I recommend the following text, (Almost) 101 Watys to Work with DATES in WebFOCUS. I would draw your attention to Example 19.4b or Table 3.14.

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


jimster06
DevStu WF 7.6.11
W7
HTML, PDF, EXL2K
April 21, 2010, 02:18 AM
GamP
If you're just always using the date portion of the field and never have need of the time portion, then it might be the smartest to change the master file. Change the usage (or format) to read YYMD and change the actual to read DATE, in stead of HYYMDs. Then you do not need to use HDATE or some such conversion method. But, you do have to watch out for re-creating the synonym... although I seem to remember that there is also a setting to create synonyms with date fields iso date-time fields.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
April 21, 2010, 07:53 PM
krishkasi
Pls check whether you can use the HCNVRT function.
Syntax is as follows.
  
ALPHA_DATE_TIME2/A20 = HCNVRT(TRANSDATE, '(HYYMDS)', 20, 'A20');



Regards,
Kasi Krishnan
WF 7.1.4 & WF 7.6.9: Databases - DB2, SQL Server 2000.
OS: Windows & AIX