November 11, 200520 yr Here's what I want to do: For each record, I want a field in which I enter a number. I want a second field on the layout to keep a sum of all the numbers entered in the first field. I do not want this sum displayed across every record in the file...I want each record to have its own separate sum. I know this one has to be easy. Thanks in advance.
November 11, 200520 yr You can easily do it from a script but everytime you will have to manually run the script, hence I am trying to find out how you can do it using a calculation field. Would you like to use a script as a solution to your question? Edited November 11, 200520 yr by Guest
November 11, 200520 yr How are the numbers separated in the field? Are you using spaces, commas, semicolons?
November 11, 200520 yr The below script should work if the field is a number field. It should give you the right results avoiding any separation character. Decfine a global field gCount. Assume that the input numeric field is A and output numeric field is B. Your script would look like: Set Field[gCount,1] Set Field[b,0] loop exit loop if[gCount>Lenght[A]] Set Field[b, B + Middle[A, gCount, 1]] Set Field[gCount, gCount + 1] end loop
November 12, 200520 yr Author Sorry. I think my description confused the issue. Here's what I have: A very simple database that records work effort. I want the user to locate the record of a particular task and enter the number of minutes he worked on the task (formatted as a whole number, not as time) in a field. Every time he does this, I want another field to display the total number of minutes spent on the task. So that field should increase every time minutes are entered. The user could be entering 3, 4, 19, 27...whatever.
November 12, 200520 yr Much better to create a portal into a related file, so that every entry creates a new record. Summing the portal data is easy using the Sum() function.
November 13, 200520 yr Is not quite clear how your file looks like, but i think you could use a self-join relationship to aggregate the data of diferent records in the same file. ZZ
Create an account or sign in to comment