Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Divide not returning decimal values 2

Status
Not open for further replies.

handle87

Programmer
Jun 27, 2005
53
CA
Hi..
When I divide and the result is a decimal I am getting 0 returned instead of the decimal number...
Code:
CASE
  WHEN a.PricingStr <> 'PreP' THEN
    21/31
  ELSE
    20/10
END As Total

I am real new to this.. any ideas why I am geting 0 returned instead of the decimal number?

 
Code:
CASE
  WHEN a.PricingStr <> 'PreP' THEN
    21.0/31.0
  ELSE
    20.0/10.0
END As Total

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Thank you both... I had tried the CAST before but it did not work... but it was in the wrong area.. as there is more code than what I type.. however, from both of your posts, I got put on the right track and have solved the problem.

Thank again!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top