Question : Math Operations in Sql Queries

Can one perform mathematical operations in the sql statement??

Like, assuming TotalGross and PSIGross are columns in my table:

SELECT Sum(TotalGross) / Sum(PSIGross) AS Percentage

Possible?

Answer : Math Operations in Sql Queries

SELECT MyField1, Sum([TotalGross])/Sum([PSIGross]) AS Percentage
FROM MyTable
GROUP BY MyField1;

Replace MyFeild1 with the field in your table that you want to group and summ on.
Replace MyTable with your table name.

ET



Random Solutions  
 
programming4us programming4us