}Date: Tue, 3 Dec 1996 09:13:17 -0800
}From: johnl@informix.com (Jonathan Leffler)
}X-Informix-List-Id: <list.12266>
}
}As posed, it will be difficult to achieve this. If the start_time was recorded
}as INTERVAL HOUR TO SECOND, then this works:
}
}SELECT EXTEND(Start_Date, YEAR TO SECOND) + Start_Time AS Start_Datetime
}FROM TableA;
}
}I've not spent many brain-cycles on how to convert a DATETIME HOUR TO SECOND
}into an INTERVAL HOUR TO SECOND.
Of course, 3 hours later when I saw my own posting, the answer was obvious...
SELECT EXTEND(Start_Date, YEAR TO SECOND) +
(Start_Time - DATETIME(00:00:00) HOUR TO SECOND) AS Start_DateTime
FROM TableA;
You convert a DATETIME into an INTERVAL by subtracting another DATETIME from
it, and since we want the value unchanged, the value to subtract is midnight!
This wouldn't work if the DATETIME includedyear, month or day components
because none of those can be zero.
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>
}>From: Sham.Vaidya@rmy.emory.edu
}>Date: 2 Dec 1996 14:32:27 -0800
}>X-Informix-List-Id: <news.31123>
}>
}>I have 2 fields on table A
}>
}>start_date - type date
}>start_time - type datetime hour to second
}>
}>I have created a new on Table A called
}>start_datetime - type datetime year to second.
}>
}>Is there any way using a simple SQL statement I can concatenate start_date
}>and start_time into start_datetime? Any other way? Any ideas appreciated....