Re: variance in mins
Posted in 2008
Topics: Stored Procedures & SPL
I tried this, but :( am I missing something?
sorry I am new in informix
select appt_nlt_date, appt_nlt_time, (extend(appt_nlt_date, year to second) +
(appt_nlt_time - "00:00:00")) from contract
Carsten Haese wrote:
>> Actually I need to
>>
>[quoted text clipped - 5 lines]
>>
>> any advice?
>
>1) Shoot the person that designed the table structure.
>
>2) Use the following function to combine separate date and time fields
>to a single datetime field:
>
>create function combine_date_time(d date, t datetime hour to second)
> returning datetime year to second;>
> return (extend(d, year to second) + (t-"00:00:00"));
>end function;
>
>HTH,
>
>--
>Carsten Haese
>http://informixdb.sourceforge.net
--
Message posted via DBMonster.com
http://www.dbmonster.com/Uwe/Forums.aspx/informix/200804/1
vchu via DBMonster.com wrote:
> I tried this, but :( am I missing something?
>
> sorry I am new in informix
>
>
> select appt_nlt_date, appt_nlt_time, (extend(appt_nlt_date, year to second) +
> (appt_nlt_time - "00:00:00")) from contract
Please feel free to elaborate on what ":(" means.
As a general guideline, when you need help with a problem, you should
always provide at least the following information:
1) What did you do?
2) What outcome did you expect?
3) What happened instead?
(Note that "It doesn't work" doesn't qualify as an appropriate answer to
question 3.)
You answered 1, but not 2 and 3.
--
Carsten Haese
http://informixdb.sourceforge.net
sorry for the confusion.
I ran this sql, but it said "extra charactors at the end of the datetime or
interval"
select appt_nlt_date, appt_nlt_time, (extend(appt_nlt_date, year to second) +
(appt_nlt_time - "00:00:00")) from contract
I am trying to combine appt_nlt_date and appt_nlt_time as a datetime field,
so that I can you for subtraction of another datetime field later.
Carsten Haese wrote:
>> I tried this, but :( am I missing something?
> >
>> sorry I am new in informix
>>
>> select appt_nlt_date, appt_nlt_time, (extend(appt_nlt_date, year to second) +
>> (appt_nlt_time - "00:00:00")) from contract>
>Please feel free to elaborate on what ":(" means.
>
>As a general guideline, when you need help with a problem, you should
>always provide at least the following information:
>
>1) What did you do?
>2) What outcome did you expect?
>3) What happened instead?
>
>(Note that "It doesn't work" doesn't qualify as an appropriate answer to
>question 3.)
>
>You answered 1, but not 2 and 3.
>
>--
>Carsten Haese
>http://informixdb.sourceforge.net
--
Message posted via http://www.dbmonster.com
vchu via DBMonster.com wrote: > sorry for the confusion. > > I ran this sql, but it said "extra charactors at the end of the datetime or > interval" That means that your appt_nlt_time is not a "datetime hour to second." It's probably a "datetime hour to minute". (Of course, if you had *told* us what it is, I wouldn't have to guess!) Try replacing "second" with "minute" and "00:00:00" with "00:00". HTH, -- Carsten Haese http://informixdb.sourceforge.net
It works now. Thanks so much.. I really appreciated your help. :) Carsten Haese wrote: >> sorry for the confusion. >> >> I ran this sql, but it said "extra charactors at the end of the datetime or >> interval" > >That means that your appt_nlt_time is not a "datetime hour to second." >It's probably a "datetime hour to minute". (Of course, if you had *told* >us what it is, I wouldn't have to guess!) > >Try replacing "second" with "minute" and "00:00:00" with "00:00". > >HTH, > >-- >Carsten Haese >http://informixdb.sourceforge.net -- Message posted via DBMonster.com http://www.dbmonster.com/Uwe/Forums.aspx/informix/200804/1