Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculating percentages
Message
 
 
To
31/10/2011 08:54:17
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01527668
Message ID:
01527676
Views:
44
If all values are integers than integer calculation is used
select @first_year_retention_rate = @no_plan_rowcount*100.0/@member_rowcount

PRINT @first_year_retention_rate
>Whats wrong with this.
>
>
>PRINT @no_plan_rowcount  
>
>
>returns 816
>
>
>PRINT @member_rowcount
>
>
>returns 416
>
>
>select @first_year_retention_rate = @no_plan_rowcount/@member_rowcount * 100
>
>PRINT @first_year_retention_rate
>
>
>returns 0
>
>What am I doing wrong .
>
>Thanks
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform