Averaging time field
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Averaging time field Expand / Collapse
Author
Message
Posted 8/5/2009 11:54:01 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/13/2009 3:26:31 PM
Posts: 4, Visits: 10
Hello there,

I am encountering an error when I am trying to perform average function on a field with data type of time(0).

For example:

sel avg(end_time)
from table1

It gave error "5407: Invalid operation on an ANSI Datatime or Interval value"

I tried:

sel sum(end_time)/count(end_time)
from table1

This failed with the same error message due to the sum function.

Has anyone encountered this problem before? If so, can someone be kindly offer a solution to this?

Thanks in advanced,
N
Post #16454
Posted 10/8/2009 4:03:45 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 10/8/2009 3:58:35 AM
Posts: 1, Visits: 1
Hi
I tried following and i am getting the result.

create table time_test
(
t1 time
)primary index(t1);

insert into d_temp_hutch.time_test('12:00');
insert into d_temp_hutch.time_test('14:00');
insert into d_temp_hutch.time_test('18:00');

sel avg(t1)
from d_temp_hutch.time_test;

Average(t1)
00:14:66




Regards
Nehal
Post #17062
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 4:48pm

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.094. 8 queries. Compression Disabled.