Tristan Shortland
asked on
SQL Server data type problem when dividing then printing...
Hi,
I have the SQL statment below and the output is this:
24 / 115
0
I need the second number to be the result of the division - what am I doing wrong??
Thanks,
Tristan
I have the SQL statment below and the output is this:
24 / 115
0
I need the second number to be the result of the division - what am I doing wrong??
Thanks,
Tristan
--Calculate Conversion rate
IF @CountUniqueVisits > 0 AND @CountPurchasers > 0
BEGIN
SET @ConversionRate = @CountPurchasers/@CountUniqueVisits
PRINT CAST(@CountPurchasers AS VARCHAR) + ' / ' + CAST(@CountUniqueVisits AS VARCHAR)
PRINT CONVERT(VARCHAR, @ConversionRate)
END
OUTPUT:
24 / 115
0
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you!