Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Analysis Services (2000)
 Cast and Sum

Author  Topic 

anarkist
Starting Member

1 Post

Posted - 2005-05-25 : 04:04:35
Hello

I'm trying to create a report.
Problem :
The Data are stored in to a tbl as CHAR data

I was able to CAST the CHAR data in to NUMERIC

Select CAST (column_name*1 as numeric) as numval wfrom tbl_name
where udf_id = 153

This give me out a column named "numval" with all data i wish in numeric format

Now i wish to summ this data

Any Idea on how to tell now to sum all data from the "numval" column?

I tried with the COMPUTE SUM , but it returns with cannot find "numval" column

Many thanks for suggestions

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-05-25 : 05:35:29
Select sum(numval) from(
Select CAST (column_name*1 as numeric) as numval wfrom tbl_name
where udf_id = 153) T


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -