Hi,

I've got 2 columns of numbers and need to divide the SUM of COLUMN 1 by the SUM of COLUMN 2.

I've tried

(SUM(col_1))/(SUM(col_2))

AS col_3 but this doesnt work.

Please help.

Kind Regards

Asil

Hi,

Actually on second pass the query DOES work. However, now I have a different issue. How can i get the resultant column to give me results with decimal places?

Thanks

Asil

You have to convert one of the columns to decimal
do something like
SUM(CAST(DECIMAL,col1))/SUM(col2)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.