
Unable to return float, always returning int with ADO, IIS and SQLServer
Hi!
I'm having a strange "bug" or "feature" that I want to get rid of. I have an
ASP page running on IIS that connects to an SQLServer and does a simple
select from a view. In a select looks like this where I calculate a
percentage:
Select Int_one, Int_two, Int_one/Int_two *100 from view;
All it returns is the two integers and the integer of the percentage! It
seems as if it doesn't return a float number, but only an integer... I have
tried this one just to make sure that it can return float values:
Select Int_one, Int_two, Int_one/Int_two *100, 0.4 from view;
This one returns the two integers, the integer of the percentage and 0.4.
Hmm... Somehow it cuts the real part.
I have tried the convert the division into a float by using the CONVERT
function:
Select Int_one, Int_two, convert(float, Int_one/Int_two *100) from view;
With the same result!
I'm using ADO to connect to the SQLServer.
Is there any settings or so that I have to do to my connection so that it
will handle float values or something?
Post to newsgroup and directly to me if possible.
Remove the nospamplease if you mail me.
Best regards,
Magnus