I've never used table names as part of a correlated update.  Maybe it doesn't 
like it?  Try this and see if it works.  Also, it doesn't seem like "standard" 
column is in the t3t table since you don't show it in the output, so I'd try 
leaving out the "t2" in the divisions):

Select t1.*, t2.activity, t2.unitmeas, t2.standard, (tothrs/t2.standard) AS 
standardunits, (units/(tothrs/t2.standard)*100) AS expectedunits FROM  t3t t1, 
activity t2 WHERE t1.activity =  t2.activity and t2.standard <> 0

 
Karen

 

 

-----Original Message-----
From: Hodges, Dennis <[email protected]>
To: RBASE-L Mailing List <[email protected]>
Sent: Thu, Sep 11, 2014 11:18 am
Subject: [RBASE-L] - Divide by Zero



I’m getting a divide by zero from the following select statement.  The values 
for tothrs and activity.standard are all positive real numbers, no zeros or 
nulls.  Does anyone have a clue as to why I’m getting this error.           
Somehow tothrs/activity.standard is evaluating to 0 as shown below.
 
Select 
t3t.*,activity.activity,activity.unitmeas,activity.standard,(tothrs/activity.standard)
 AS standardunits,(units/(tothrs/activity.standard)*100) AS expectedunits FROM  
t3t, activity WHERE t3t.activity EQ activity.activity and activity.standard <> 0
                Tothrs   Units     Activity UnitMEas            Standard        
      StandardUnits  
         1.5           1.5           033          Manh                       1  
                                            0
         2              2              032          Manh                       
1                                              0
         6.5           6.5           941          Manh                       1  
                                            0
         4              4              520          Unit                        
 0.83                                         0
         6              11            520          Unit                         
0.83                                         0
         10            20            520          Unit                         
0.83                                         0
         3              3              028          Manh                       
1                                              0
         5              130           526         LnFt                         
0.25                                         0
         10            14            520          Unit                         
0.83                                         0
 
 
Dennis Hodges
Maintenance Management Manager
FDOT Office of Maintenance MS #52
PH: (850) 410-5635
FAX: (850) 410-5511
[email protected]
 
As far as we know, our computer has never had an undetected error.
 
Please note: e-mail may be subject to public disclosure.
 


Reply via email to