Focal Point
[CLOSED] Concat date and time fields to make a timestamp field

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

September 04, 2009, 04:23 PM
Tomsweb
[CLOSED] Concat date and time fields to make a timestamp field
I have these time and date fields:

quote:

RTIMEF MR_DATE
00:30:00 10/11/08


And, I want to concat them to make a timestamp field like:

quote:

RTIME_D
10/11/08 00:30:00


When I look at the field formats from a SAVE file...
quote:

ALPHANUMERIC RECORD NAMED SAVE
0 FIELDNAME ALIAS FORMAT LENGTH
AR_DATE A6YMD 6
RTIMEF A08 8
MR_DATE MDY 6
TOTAL 20


I am not sure what I am missing to be able to concat these to show the timestamp field
in a report.

quote:

DEFINE FILE APPLES
RECD_DT/A20 = MR_DATE | ' ' | RTIMEF;
END


Any ideas? Idea
Thanks!

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


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
September 04, 2009, 04:56 PM
Darin Lee
Your code is not creating a timestamp field. It is only creating an alphanumeric string containing a date and time. I know that sounds picky but the formats for each are entirely different and they can't be used interchangeably.

If you want to create an actual timestamp field, try the HINPUT function. If you only need an alpha string just

DEFINE FILE filename
DTTIM_STRING/A15=AR_DATE | ' ' | RTIMEF;
END


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
September 04, 2009, 09:45 PM
Tomsweb
What I am actually trying to do is break a database field in HYYMDS format which displays as:
2009/01/01 09:35:00

to display as:
01/01/09 09:35:00


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
September 05, 2009, 05:26 AM
GamP
You could use the HCNVRT function to convert your HYYMDS field to alphanumeric, and then use EDIT on the converted field to pick out the substrings in the order that you need.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
September 06, 2009, 05:41 PM
Waz
Would this help ?

TABLE FILE CAR
PRINT COUNTRY
 COMPUTE DTS1/HYYMDS = DT(20090101 09:35:00.000) ;
 COMPUTE DTS2/HDMYS = DTS1 ;
END



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!