Joined: 21 Nov 2005 Posts: 31 Topics: 10 Location: Orange County, California
Posted: Tue Feb 03, 2009 7:11 pm Post subject: Can a timestamp be formatted by a concatenation?
I have a table to which I have added a new timestamp column (CREATE_DATE) . On a go forward basis, this column will be populated each time a row is added to the table with the current timestamp.
I have a column in the table called WRKPERIOD in DATE format. This column plus 2 months represents the date when the row was created, but I would like to somehow use this column (with the 2 months added in) and concatenate it with a fixed time in the format of HH:MM:SS.MMMMMM to create my new timestamp. The desired result would be a column that is in normal timestamp format.
Is there a way to do this without writing a COBOL program that would require two passes against the table?
Here's what my original SQL looks like minus the update of the CREATE_DATE timestamp column:
Code:
UPDATE HOURS.A2BKCNT X
SET X.FAMILY_ID =
(SELECT Z.FAMILY_ID
FROM FDBEL.REG_MASTER Z
WHERE X.SSNO = Z.PART_SSNO AND 0 = Z.RELATION_ID),
LASTUPDT = CURRENT TIMESTAMP,
USERID = 'JMN FAMID',
CREATE_USERID = 'FBHR216'
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum