I would assume the 1st row in the view may have 0 (Zero). Are the realhrs based on employee, company or some other unique id.
From: [email protected] [mailto:[email protected]] On Behalf Of Hodges, Dennis Sent: Wednesday, May 28, 2014 12:27 PM To: RBASE-L Mailing List Subject: [RBASE-L] - RE: Adding Columns with zeros Even stranger, adding 1 to realhrs gives 1 in every row. R>connect wdoss Database Exists R>select realhrs, safhrs, callhrs, (realhrs+1) as mytothrs from t3t realhrs safhrs callhrs mytothrs --------------- --------------- --------------- --------------- 8. 0. 0. 1. 10. 0. 0. 1. 7. 0. 0. 1. 7.25 0. 0. 1. 10. 0. 0. 1. 6.5 0. 0. 1. 8. 0. 0. 1. 1. 0. 0. 1. 2. 0. 0. 1. 2.5 0. 0. 1. 3. 0. 0. 1. 5. 0. 0. 1. 6. 0. 0. 1. 7. 0. 0. 1. 8. 0. 0. 1. 9. 0. 0. 1. 9.5 0. 0. 1. 0.5 0. 0. 1. Dennis Hodges Maintenance Management Manager FDOT Office of Maintenance MS #52 PH: (850) 410-5635 FAX: (850) 410-5511 <mailto:[email protected]> [email protected] Please note: e-mail may be subject to public disclosure. From: [email protected] [mailto:[email protected]] On Behalf Of Buddy Walker Sent: Wednesday, May 28, 2014 12:17 PM To: RBASE-L Mailing List Subject: [RBASE-L] - RE: Adding Columns with zeros Dennis Is the column tothrs already in your view? Buddy From: [email protected] [mailto:[email protected]] On Behalf Of Hodges, Dennis Sent: Wednesday, May 28, 2014 12:05 PM To: RBASE-L Mailing List Subject: [RBASE-L] - RE: Adding Columns with zeros All fields are double. Here is the result. R>connect wdoss Database Exists R>show zero (ZERO ) ON Treat nulls as ZERO in numeric calculations R>browse realhrs, safhrs, callhrs, (realhrs + 0) as tothrs from t3t R>Select realhrs, safhrs, callhrs, (realhrs + safhrs + callhrs) as tothrs from t3append realhrs safhrs callhrs tothrs --------------- --------------- --------------- --------------- 8. 0. 0. 0. 10. 0. 0. 0. 7. 0. 0. 0. 7.25 0. 0. 0. 10. 0. 0. 0. 6.5 0. 0. 0. 8. 0. 0. 0. 1. 0. 0. 0. 2. 0. 0. 0. 2.5 0. 0. 0. 3. 0. 0. 0. 5. 0. 0. 0. 6. 0. 0. 0. 7. 0. 0. 0. 8. 0. 0. 0. 9. 0. 0. 0. 9.5 0. 0. 0. 0.5 0. 0. 0. Dennis Hodges Maintenance Management Manager FDOT Office of Maintenance MS #52 PH: (850) 410-5635 FAX: (850) 410-5511 <mailto:[email protected]> [email protected] Please note: e-mail may be subject to public disclosure. From: [email protected] [mailto:[email protected]] On Behalf Of Javier Valencia Sent: Wednesday, May 28, 2014 12:00 PM To: RBASE-L Mailing List Subject: [RBASE-L] - RE: Adding Columns with zeros What type are the columns? To add they must not be TEXT. Try the following and see if it works: Select realhrs, safhrs, callhrs, (realhrs + safhrs + callhrs) as tothrs from t3append Now you should see the individual values and the sum. Javier, Javier Valencia, PE O: 913-829-0888 H: 913-397-9605 C: 913-915-3137 From: [email protected] [mailto:[email protected]] On Behalf Of Hodges, Dennis Sent: Wednesday, May 28, 2014 10:16 AM To: RBASE-L Mailing List Subject: [RBASE-L] - RE: Adding Columns with zeros I see the column, it just has zeros in each row. Dennis Hodges Maintenance Management Manager FDOT Office of Maintenance MS #52 PH: (850) 410-5635 FAX: (850) 410-5511 <mailto:[email protected]> [email protected] Please note: e-mail may be subject to public disclosure. From: [email protected] [mailto:[email protected]] On Behalf Of Javier Valencia Sent: Wednesday, May 28, 2014 11:12 AM To: RBASE-L Mailing List Subject: [RBASE-L] - RE: Adding Columns with zeros Dennis, I tried the same thing and it works fine for me . However, when you use the SELECT command the columns display is limited by the display width and you might not be seeing all the columns, since the computed column will show up at the end (right) after all the other columns selected by "*" are dis[played. Try using BROWSE instead of SELECT and see if all columns display correctly. BROWSE *, (realhrs + safhrs + callhrs) as tothrs from t3append Or simply change the order: Select (realhrs + safhrs + callhrs) as tothrs, * from t3append And now the computer column should show as the first column. Javier, Javier Valencia, PE O: 913-829-0888 H: 913-397-9605 C: 913-915-3137 From: [email protected] [mailto:[email protected]] On Behalf Of Hodges, Dennis Sent: Wednesday, May 28, 2014 7:56 AM To: RBASE-L Mailing List Subject: [RBASE-L] - Adding Columns with zeros I have a view with production data that includes 3 columns for hours and I want to create a total hours column. I previously converted null values on all three columns using ifnull(realhrs,0,realhrs). The following gives me zeros for tothrs: Select *, (realhrs + safhrs + callhrs) as tothrs from t3append Any help would be greatly appreciated. Dennis Hodges Maintenance Management Manager FDOT Office of Maintenance MS #52 PH: (850) 410-5635 FAX: (850) 410-5511 <mailto:[email protected]> [email protected] Please note: e-mail may be subject to public disclosure.

