Q
Problem solve Get help with specific problems with your technologies, process and projects.

# Columns displaying wrong decimal from calculation

## Web Development

### Looking for something else?

I have a view that displays imported employees attendance documents from a .txt file. This view has columns, a couple of which are hours and minutes. When I try calculating hours + minutes for each individual employee, I get the correct total figure in decimal format, just a little off. For example, if an employee worked 7.5 hours, the column will display 7.67.

How can I get the column to display 7.5 hours instead? The formula that I am using in the column is:

```@Sum(minutes)/60 + @Sum(Hours)
```
Your help with this is greatly appreciated.
Assuming the Hours field contains 7 and the Minutes field contains 30, I see no reason the result should be 7.67. Are you sure the Minutes field doesn't contain 40?

I don't understand why you use @Sum. Are these multivalued fields? If not, @Sum doesn't do anything useful. If so, then what values are you using to represent 7.5 hours?

If the fields are multivalued and Minutes contains, say, 30 and 10, then the formula is returning the correct result.

Use the document properties box from a view (highlight a document and press Alt+Enter) to see the actual values of these fields (on the second tab of the dialog). It might be that they don't have exactly the values that you think they do.

Member clarification:
Andre, first I would like to thank you for taking the time to read and answer my e-mail. Somehow though, there was some misunderstanding that may have been caused by my explanation.

I have a form "TATC" and on that form I have many fields, among those fields are two field "hours" and "minutes." The value of all the fields on the forms is imported from a .txt file and saved into the document. As these documents are attendance documents, each employee will have at least four documents per day, in which case I need to total the amount of hours worked per that day. When I try to display the daily total `@Sum(minutes)/60 + @Sum(Hours)`, which give me the minutes in decimal value as a portion of a hundred. I have no problem with the hours because as soon as the minutes portion hits 100% (equivalent to 60 minutes) then the hour is added to the hours.

My question was: Instead of the value of minutes display in decimal (portion of 100% of 60 minutes), I just want to display as is. For example, when an employee has worked 7 hours and 30 minutes, I would like to column to display 7.5 (.5 being half of the hour or 30 minutes from the 60 minutes of the hour).

I am so sorry for my lengthy explanation, and I hope that it help you to understand the problem better. I have tried many ways to go around the problem by using @int and integer functions and so on, but nothing worked.

Andre's response:
I still don't exactly understand what you're doing. I tried what I think you are describing, and I don't get 7.67 as a total. Perhaps I can explain to you what I did, and you can tell me how your situation is different.

I created a sample database that contains one form, Timecard, and one view. Each Timecard document contains one Hours number and one Minutes number.

The view contains a column with the formula `@Sum(minutes)/60 + @Sum(Hours)`. The @Sum doesn't actually do anything useful, since there is only one number in each document to sum. So I could have used this formula instead, and it would do the same thing: `Minutes/60 + Hours`

Here's what the view looks like:

Donald Duck worked 7 hours and 30 minutes, and the correct number 7.50 is displayed. This column also displays totals, so Roy Blount, who worked a total of 6 hours and 90 minutes stored in four separate documents, also has a correct total value 7.50 is displayed. I don't know where you're getting 7.67.

One thing you might want to do is examine the properties of the individual documents to make sure you know exactly what values they contain and what their datatypes are. Highlight a document in the view, and open the properties dialog by pressing Alt+Enter. Here's the tab that shows field information. Notice the Data Type of the field, which should be Number, and the value -- 5 in this case.

This was last published in February 2005

#### Have a question for an expert?

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

#### Start the conversation

Send me notifications when other members comment.

## SearchWindowsServer

• ### Future of Windows might involve significant weight loss

The influence of containerized applications could sway Microsoft to introduce more far-reaching refinements to Windows Server and...

IT workers need to learn how to ride the wave of innovation and master these five technologies related to Windows Server that can...

• ### Options for server management tools expand to meet IT needs

Not only do admins have to contend with a mix of server OSes, there are diverse scenarios to complicate their management. Learn ...

## Search400

• ### iSeries tutorials

Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

• ### V6R1 upgrade planning checklist

When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

• ### Connecting multiple iSeries systems through DDM

Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

## SearchDataCenter

• ### IBM Power9 servers seek market inroads to AI, cloud

IBM follows up its first Power9 server with a raft of systems designed to appeal to a wider array of markets -- most notably, AI ...

• ### Evaluate read-intensive and write-intensive SSD use cases

Consider write wear, performance and other factors when choosing between read-intensive, write-intensive and mixed-use ...

• ### Some hyper-converged infrastructure use cases pose pitfalls

Hyper-converged infrastructure adoption is skyrocketing, but that doesn't mean that the technology is the best choice for every ...

## SearchExchange

Everyone wants a smooth patching process, but things can fall apart despite everyone's best efforts. Develop a solid recovery ...

• ### New Office 365 administrators grapple with challenges

More enterprises mulling the move to Office 365 should factor in the adjustments necessary to get the IT department up to speed ...

• ### Curb stress from Exchange Server updates with these pointers

Some administrators let the memories of a bad patch linger and put off Exchange updates. Here are some tips to make this ...

## SearchContentManagement

• ### Content management in the cloud a main theme in 2018

The future of content management resides in the cloud and with AI, as several 2018 conferences will assure you.

• ### Six things to know about today's SharePoint implementations

As companies migrate their on-premises Microsoft SharePoint sites to the cloud, here are some things they should know about the ...

• ### Upgrades for the SharePoint Online portal

As more organizations migrate SharePoint sites to the cloud, Microsoft has increased at-a-glance dashboard data and analytics to ...

Close