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
stop error 0x000000d1 (0x00000000, 0x00000002, 0x00000000, 0x00000000) DRIVER_IRQL_NOT_LESS_OR_EQ<wbr />UAL
Exchange 2007 Storage Groups
Combo Box Events
Outlook voting button no response summary
Access security query
Hide root node in Menu using xmldatasource
My App can't find Crystal Decisions DLL after it is moved to another computer.
Pivot Table Form - Display Null Values as "0" on Data Axis
Stored Procedure Execution Options
blue screen errors...