Archives of the TeradataForum
Message Posted: Thu, 20 Jul 2006 @ 09:35:46 GMT
Subj: | | Re: Most efficient way to add hours to a date field? |
|
From: | | Dieter Noeth |
Vivek Pandey wrote:
| What is the most efficient way to add hours as integer to a date field? I have 2 columns one is integer and another as time and I need to
add them. I know that I can use the extract function and do MOD to perform the same in a conditional statement. Is there any better way? | |
select timecol + (intcol * interval '1' hour)
If intcol exceeds 9999 then use:
intcol * interval '0000 ?01' day to hour
Dieter
|