Microsoft
Software
Hardware
Network
Question : SQL 2008 - Need to use calcualted field in another calculation
I need to use a calculated field in a query in another area of the same query. I have
SUM(tbl_nav_now - nav_past) AS Change, and I tried the following
Sum(Change / tbl_nav_now) AS Percent but it did not like it. What would be the correct syntax with rounding?
Any help is appreciated.
Answer : SQL 2008 - Need to use calcualted field in another calculation
are you ignoring my post?
Sum(Change / tbl_nav_now) AS Percent
-->
Sum((tbl_nav_now - nav_past) / tbl_nav_now) AS Percent
if you exactly want x.xx format you should use cast
Cast(Sum((tbl_nav_now - nav_past) / tbl_nav_now), decimal(10,2)) AS Percent
Random Solutions
Hiding Network Folders
MYSQL first day (or month) of the current quarter and previous quarter
Calculating 2 processors issue in excel
MS ACCESS SQL QUERY - Export Access Query Results to PowerPoint
need help! exists subqueries are killing mysql server in production environment
IBM drivers MT-M 8184-CTO
Create a GUI using C Sharp
Error - Excel could not save all the data and formatting you recently added to myfile.xla ...
WPF Control will not hide button or check box....
Can't open MS Access DB