Q:

lotus notes calculate total time/days for view entries

There is view listing a certain number of documents having as view selection a form.  A column ( Style = Date/Time displaying Time ) has the formula: time_1.  The next column is displaying: time_2. 
with other words: 
time_1 - the time the user was at work. 
time_2 - the time the user must be at work ( let's say  08:00 hours ). 
There is a view action button:
t1:=@DbColumn("Notes":"NoCache";"server/Company":"Name.nsf";"vwSearchResult";6);
total1:= @Sum(@ToNumber(t1)) ;
t2:=@DbColumn("Notes":"NoCache";"server/Company":"Name.nsf";"vwSearchResult";7);
total2:= @Sum(@ToNumber(t2)) ;

zile:=(total1-total2)/8; // 8 - is the minimun number of hours / day. "  I must be at work minimum 8 hours "

@Prompt([Ok];"Time at work";@Text(total1));
@Prompt([Ok];"expected time";@Text(total2));
@Prompt([Ok];"Additional time - in days ";@Text(zile))

Just the 2nd Prompt is calculated correctly.  The 1st prompt result is an integer number, and of course, implicitly the 3rd prompt is not displaying the result correctly. 
How can I achieve this? 

A:

Change your formula to
t1:=@DbColumn("Notes":"NoCache";"server/Company":"Name.nsf";"vwSearchResult";6);
total1:= @Sum(t1 - [00:00]) / 3600;
t2:=@DbColumn("Notes":"NoCache";"server/Company":"Name.nsf";"vwSearchResult";7);
total2:= @Sum(t2 - [00:00]) / 3600;

You can't convert a time value to a number with @ToNumber.  Instead, calculate the difference between your time and 00:00.  This gives you the number of seconds of your time. 
Divide this by 3600 and you get the hours.