View Single Post
  #4  
Old 09-13-2006, 11:27 AM
NEILLE NEILLE is offline
OSP Starters
 
Join Date: Sep 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
NEILLE is on a distinguished road
Default

In fact if you are using mysql you could even do this:
Code:
select
coalesce(gp/sales,0) as gp_percent
from yourtable
the coalesce says that if your result would be null then just show 0 in the gp_percent output. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  Webmaster Forums - View Single Post - How would I do this in PHP?
View Single Post
  #4  
Old 09-13-2006, 11:27 AM
NEILLE NEILLE is offline
OSP Starters
 
Join Date: Sep 2006
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
NEILLE is on a distinguished road
Default

In fact if you are using mysql you could even do this:
Code:
select
coalesce(gp/sales,0) as gp_percent
from yourtable
the coalesce says that if your result would be null then just show 0 in the gp_percent output. -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote