Division used to work, it did...
Date: 09/27/07
(SQL Server) Keywords: sql
Here's a T-SQL (SQL2005) statement for you.
UPDATE @m_tblAllSalesStaging SET UnitsPercentChange4 = (TYUnits_4Wks/LYUnits_4Wks)*100 WHERE UnitsPercentChange4 IS NULL
Here's some of my result set (the columns are TYUnits_4Wks, LYUnits_4Wks, and UnitsPercentChange4):
5126 6240 0.00
24 156 0.00
64 141 0.00
10 36 0.00
2180 2541 0.00
0 2 0.00
2 48 0.00
0 12 0.00
More interesting, this is the same logic I'm using for the dollars columns that come just before, and the division is working swimmingly.
I have no clue why it's not picking anything up. Anyone have any ideas? Thanks.
Source: http://community.livejournal.com/sqlserver/63508.html