Jump to content

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

Recommended Posts

Posted

I have a scheduling db that allows users to enter start and stop time for the jobs they are working on. The fields for time are a portal to a timesheet db that i use to produce daily time sheets for the employees. i have a script set up where the user enters his name and the date. the script then finds and sorts(based on time) all of the records for that user and for the date I need the time sheet for. In the header of the timesheet db, I need beginning and ending fields to show what time the employee started and ended his day. This is always the first start time and the last end time of the day. I need to have those time appear in the header. I was am trying to create a field that picks up the first start time and another that picks up the last end time but am not having much luck. Any help would be great.

Posted

Use the Max and Min functions to get the times:

EarliestStart = Min(Timesheet::StartTime)

LatestEnd = Max(Timesheet::EndTime)

Assuming that your "Timesheet" relationship is by Employee.

Posted

This works within eaqch record but I need to find these values for a collection of records. Each operation is it's own record. I also have the start and finish times in the header which migh be causing another problem.

Posted

Max and Min will work across a range of records via a relationship. Since you already have a portal set up that shows the start and end times for a particular employee for that day, you should be able to use that same relationship (unless I'm misunderstanding how you have things setup). In my previous post, I assumed that the relationship was called "Timesheet" and included it as part of the formula. In any event you will need to have a relationship that will return all the entries for a particular employee and day, and use that in the Max and Min functions.

You can create calc fields in the parent and child files that concatenate the Employee number and date like this:

EmployeeIDno & "" & Date

Then use these as the key fields for the relationship.

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