Jump to content

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

Recommended Posts

Posted

I have a database with a registers for a tasks (surgical procedures to be performed in a a given date). This registers have a field with the expected duration of the intervention (say 'dur').

When planning the activity of that day, we assign a order number (say 'ord') to every register of that day, and reorder it to obtain the surgical schedule.

I have another field (a global one, say 'interglob') to introduce the time expected to be lost between procedures.

There is another two fields in every register : the beginning time (say 'beg', empty) of each procedure and their end (calculated = 'beg' + 'dur').

I would like to have a script to populate the field 'beg' in this way : register with 'ord' = 1, '8:30' (first procedure of the day). Next register ('ord' = 2) get 'beg' = 'end' of reg. 1 + 'interglob'. Next register ('ord' = 3) get 'beg' = 'end' of reg. 2 + 'interglob', and so on...And, only in the selected searched records.

Posted

I hope that you mean you have a related file for each task when you say registers. If so the task should be easy. You script in the first file would be something like this:

Go to related record show only related records

Perform script in related file

Refreash window

The script in the related file would look something like thsi:

Sort by ord

Go to first record

Set StartTime to 8:30 (EndTime is calculated StartTime + Dur)

Loop

Set GlobalStartTime to EndTinme + Interglob

Go to next record exit after last

Set StartTime to GlobalStartTime

End Loop

This topic is 7537 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.