Jump to content

Help with MM:SS format and Caluclation


This topic is 7863 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a form that has a duration field in which we put in times in a mm:ss format. This was originally a text field. It worked for sorting and finds so there was no need to change it. Howver, now we need to do caluclations with that time and I've changed it to a time field and everything's gone to hell. The numbers are still there but all my references and scripts that reffer to those numbers are off. If I do searches on a particular number it returns all kinds of random entrys. I'm not sure what to do to fix this problem.

I'd be happy to provide as much info as possible. This is the script that's giving me problems right now.

Case( EPL 2::Format = "9/8" and EPL 2::HHOFYN = "Y", GetRepetition( Color plate, 5 ),

EPL 2::HHOFYN = "Y" and EPL 2::Current Running Time < "93:00" , GetRepetition( Color plate , 3),

EPL 2::Format = "10/9" and EPL 2::Current Running Time < "88" and EPL 2::Current Running Time <> "???", GetRepetition( Color plate , 3),

EPL 2::Format = "9/8" and EPL 2::Current Running Time < "88:00" and EPL 2::Current Running Time <> "???", GetRepetition( Color plate , 3),

EPL 2::Format = "9/8" and EPL 2::Current Running Time = "88:00" and EPL 2::Current Running Time <> "???", GetRepetition( Color plate ,2),

EPL 2::Format = "9/8" and EPL 2::Current Running Time > "88:00" and EPL 2::HHOFYN <> "Y" and EPL 2::Current Running Time <> "???", GetRepetition( Color plate ,4),

EPL 2::Format = "10/9" and EPL 2::Current Running Time > "88:00" and EPL 2::HHOFYN <> "Y" and EPL 2::Current Running Time <> "???", GetRepetition( Color plate ,4),

EPL 2::Format = "8/7" and EPL 2::Current Running Time = "88:00" and EPL 2::HHOFYN <> "Y" and EPL 2::Current Running Time <> "???", GetRepetition( Color plate ,6),

EPL 2::Format = "13/12" and EPL 2::Current Running Time > "100:00" and EPL 2::Current Running Time <> "???", GetRepetition( Color plate ,1),

EPL 2::Format = "8/7" and EPL 2::Current Running Time = "66:00" and EPL 2::Current Running Time <> "???", GetRepetition( Color plate ,1),

EPL 2::Format = "12/11" and EPL 2::Current Running Time = "110:00" and EPL 2::Current Running Time <> "???", GetRepetition( Color plate ,1),

EPL 2::Format = "15/14" and EPL 2::Current Running Time = "133:00" and EPL 2::Current Running Time <> "???", GetRepetition( Color plate ,1),

EPL 2::Format = "20/19" and EPL 2::Current Running Time = "176:00" and EPL 2::Current Running Time <> "???", GetRepetition( Color plate ,1),

EPL 2::Format = "8/7" and EPL 2::Current Running Time > "66:00" and EPL 2::Current Running Time < "88:00" and EPL 2::Current Running Time <> "???", GetRepetition( Color plate ,4),

EPL 2::Format = "12/11" and EPL 2::Current Running Time > "110:00" and EPL 2::Current Running Time <> "???", GetRepetition( Color plate ,4),

EPL 2::Format = "15/14" and EPL 2::Current Running Time > "133:00" and EPL 2::Current Running Time <> "???", GetRepetition( Color plate ,4),

EPL 2::Format = "20/19" and EPL 2::Current Running Time > "176:00" and EPL 2::Current Running Time <> "???", GetRepetition( Color plate ,4))

Some of the colors work and others don't. I'm not quite sure how to fix this.

Any help would be awsome.

Thanks,

Jack

EDIT----

Here's a question that might help me. How could I copy information in a field to appear in a different field. It would have to work so that no matter what I changed in the primary field it would change it in all the other related fields.

Thanks,

Jack

Link to comment
Share on other sites

My first reaction is: Go back to your old file (which hopefully you backed up) with the time field still Text and all scripts etc. working fine. Then add a new field that is a Calculation of type Time that is = TextToTime(Current Running Time).

Then, wherever your new requirements need to view that field as a Time rather than Text, use the calculation field. All other stuff designed to work with the Text field can continue working with the Text field.

Even if you really want to purge the text field, I still recommend this approach... then change each script and calc one-by-one... all should be working ... then change the next one... avoid the "big bang" where all kinds of things are breaking. Eventually, when you've replaced all references, you can get rid of the old Text field effortlessly.

Link to comment
Share on other sites

Here's a question that might help me. How could I copy information in a field to appear in a different field. It would have to work so that no matter what I changed in the primary field it would change it in all the other related fields.

Depending on your structure, you might either simply define all the other fields as calculations which reference your 'primary' field.

Alternatively, you might consider creating a special self-join relationship which uses a RecordID field and trigger field with a formula along the lines of:

Case(IsEmpty(YourPrimaryField), RecordID, RecordID)

and set up the self-join relationship to match the calc field with the RecordID field.

Then if you define your secondary fields as look-up fields to copy a new value from the primary field based on the self-join relationship, the lookup will cause the data to be refreshed each time the entry in the Primary field changes.

Link to comment
Share on other sites

This topic is 7863 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.