Ronald Cree Posted November 11, 2005 Posted November 11, 2005 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.
Sanjai Posted November 11, 2005 Posted November 11, 2005 (edited) 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, 2005 by Guest
-Queue- Posted November 11, 2005 Posted November 11, 2005 How are the numbers separated in the field? Are you using spaces, commas, semicolons?
Sanjai Posted November 11, 2005 Posted November 11, 2005 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
comment Posted November 11, 2005 Posted November 11, 2005 I think you are adding digits, not numbers.
Ronald Cree Posted November 12, 2005 Author Posted November 12, 2005 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.
comment Posted November 12, 2005 Posted November 12, 2005 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.
ZuperZZ Posted November 13, 2005 Posted November 13, 2005 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
Recommended Posts
This topic is 6952 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now