yalebulldog Posted February 25, 2003 Posted February 25, 2003 Hello! First, I must say that this forum is a terrific resource and thanks to all those who have help me and the others with their database issues. Now, I have a scripting problem I think may stump some of the experts, but hopefully not I created a looping script(thanks in part to this site) that creates new records based on a time start and time end and for two different variables, below is the script: Set Field [gnexttime_1, gtimestart_1] Set Field [gnexttime_2, gtimestart_2] Loop starts Set Field [Time Start_1, gnexttime_1] Set Field [Time Start_2, gnexttime_2] Set Field [bus_1, gbus_1] Set Field [bus_2, gbus_2] Set Field [gnexttime_1, gnextime_1 1800(adds 1/2 hour)] Set Field [gnexttime_2, gnextime_2 1800(what I need here is a calc that adds a blank space until the start from Time Start_1 is 15 minutes form Time Start_2) Below is an example of what I mean. Time Start 1 1:30 2:00 2:30 2:45 time start 2 3:00 3:15 Okay, hope the explanation was adequate and as always appreciate any assistance in this problem.
LiveOak Posted February 25, 2003 Posted February 25, 2003 Nope, you've got me confused. First I don't understand the concept of adding a space to a time. Time fields don't recognize spaces and spaces are concatenated, not added (+). It would be useful to know the types of all the fields. Also, I think we need a little more of a view of the forest before we get to the trees. What are you trying to do with all this? -bd
yalebulldog Posted February 25, 2003 Author Posted February 25, 2003 I thought there might be some confusion; because when they told it me I did not understand either at first. Basically, I am setting up a shuttle bus schedule that leaves at a certain time from one location (gym) to the fields (athletics). There are two buses making this run, one leaves at certain time and second bus start making its runs at a later time. The time start of the second bus could change, depending on the perceive volume for that day. The problem is when posting the schedule people were confused when the departure times run side by side (could be a formatting issue). They thought the second bus started 15 minutes later and did not pay attention to the actual start time. Yes, I know just read the schedule, this is what I said!!! But apparently it caused a lot of confusion. Therefore if the first bus started a 1:00 and the second bus started a 2:45 the schedule must not show anything in column 2(second bus) until the start time of (2:45) is fifteen minutes later from that of the first bus schedule run at 2:30 Bus 1 - 1:00 Bus 2 - Nothing Bus 1 - 1:30 Bus 2 - Nothing Bus 1 - 2:00 Bus 2 - Nothing Bus 1 - 2:30 Bus 2 - 2:45 Actual start time of bus 2 Bus 1 - 3:00 Bus 2 - 3:15 Bus 1 - 3:30 Bus 2 - 3:45 I think you get the idea now. Thanks for anyone help.
LiveOak Posted February 26, 2003 Posted February 26, 2003 I think I've got it. I'll use a simplified version using calculations: Time (time) gBus 2 Start (global,time) Bus 1 Time (calculation, time) = Time Bus 2 Time (calculation, time) = Case( Time >= (gBus 2 Start - 900), Time + 900, TextToTime("")) You will need your script to fill in Time and another calculation to put the two time fields together with the text you want to print (if you are printing the entire schedule from FM). -bd
yalebulldog Posted February 27, 2003 Author Posted February 27, 2003 Thanks BD, I will try it out and let you know the results. I appreciate your help! Best, fr
yalebulldog Posted February 27, 2003 Author Posted February 27, 2003 Okay- I'm confused!! I know you simplified your version, but I am not sure where to plug in my times into the current calculations. I'm still working on it though. Help!!!
LiveOak Posted March 5, 2003 Posted March 5, 2003 I mostly depends upon how the structure of the file is organized. In my calculation, I've assumed that each line of time is a separate records. You script, in this case, would create records and fill in the time for the first bus. The calculations would then generate the correct entry for the second bus based upon the information provided by the global field. -bd
Recommended Posts
This topic is 7938 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