January 12, 200917 yr Hello, I need help with what would appear to be a basic calculation, but it's not working and I haven't been able to determine why not. My calculation is written as follows: TimeElapsed = Table1::TimeEnded - Table1::TimeBegin with the result a Time. TimeBegin is auto-entered; TimeEnded is a scripted button entry. Both entry fields have good data, properly formatted. I want the result to appear as a time and formatted: hh:mm:ss Problem: The result field is blank. Can an amount of time be calculated this way? Or is it more involved? Thanks
January 12, 200917 yr Maybe that the solution is as simple as add this step at the end of your script: Committ record/request [ ]
January 12, 200917 yr Why are you referencing fully qualified field names? Is the calculation field in another table?
January 12, 200917 yr Author No it isn't and I'm puzzled by that as well. FM added that to the calc and will not allow me to rewrite it as simply: Result = Field1 - Field2 It is in a related table, but that should have nothing to do with it, I wouldn't think. Seems buggy.
January 12, 200917 yr No it isn't, but it is? I am not sure how to read this. If the calculation is in a related table, it can have a LOT to do with it. For example, there might be no related record to supply the data.
January 12, 200917 yr TimeElapsed = Table1::TimeEnded - Table1::TimeBegin with the result a Time. Result = Field1 - Field2 Result should be a number
January 12, 200917 yr Author Sorry for the confusion. The calculated field and the source fields are in the same table. The table has a relationship to another one.
January 12, 200917 yr Author Thanks Lee, but it didn't fix it. Will I be able to have the hhmmss formatting in a number field? Assuming I can ever get it to work.
January 12, 200917 yr It seems that you have more than one occurrence of this table. Why don't you try the following: Go to a layout of the table; Go to Define Database and open the calculation formula for the field; Make sure that the popup menu above the field names says "Current table"; Make sure that the popup menu 'Evaluate this calculation from the context of…" is set to the same table occurence; Re-enter your formula. If that doesn't help, post your file.
January 12, 200917 yr John probably you made a calculation in the wrong contest... Can you post your file ? ( a clone w/o records ) Edit: comment is always quikier than me :
January 12, 200917 yr No, you will need to covert it through a calculation. I posted a CF on Brian Dunnings site that may help you. Link There are others.
January 12, 200917 yr Author Here's the file. It's a work in progress. The calc field is named Duration. Thanks CommunicationsLog_Clone.fp7.zip
January 12, 200917 yr your duration field is broken, because it is coming from a file not attached, called communications log Lee
January 12, 200917 yr Author Yes, this is doing what I wanted it to, with one exception. It is leaving the hh portion of the result set at 12, rather than 00. The times entered were 12:xx:xx, so it's as if it isn't evaluating the hh portion. That's a little strange. I can work around it by setting the Result field Time formatting to mmss, but it kills the ability to track events longer than 60 minutes. Thanks for the help. Edited January 12, 200917 yr by Guest
Create an account or sign in to comment