July 13, 200520 yr FMPV7 - I am developing a time card layout. The user needs to enter up to 21 days worth of date, time-in, time-out etc. I would like to be able to have the user enter the first date and then on the next line when they click on the date field have the script enter the Next Days Date automatically. I could use some help in developing the script steps or the calculation. Thanks Bob...
July 14, 200520 yr Hi Bob, You haven't explained your structure but I believe this should work for you ... You will want to increment by date per employee independently so you need to create a self-join (another table occurrence of your timecard table) joining StaffID = StaffID. I don't think it needs to be sorted because they will be sorted naturally (unsorted, smile) by WorkDate date. I have omitted weekends in the first calc. But if the staff works the weekend they can change the date and it will begin moving forward from there again. WorkDate (standard date field with) as Auto-Enter (checked Do Not Replace Existing Value), and in calc box, checked 'Do Not Evaluate if All Referenced Fields are Empty': Last(self-join::WorkDate) + 1 + Choose( Mod ( Last(self-join::WorkDate) + 2 ; 7 ); 2; 1) If you want every day included, it would be: Last(self-join::WorkDate) + 1 A final thought: I usually don't allow staff to generate time records. Instead I would script it; which runs through the current staff records and loop-creates the necessary month records. Why? Because staff will forget or make mistakes. You will have holes and errors and an unhappy Payroll Dept. I create the records for them; they simply indicate hours worked (or vacation or whatever). Much would depend upon whether they were full- or part-time. They are not allowed to delete time records either. But that's just me. LaRetta
July 14, 200520 yr Author Thanks for the response LaRetta. I believe you have answered my question. I'll try your solution and let yo'all know how I make out. Bob...
Create an account or sign in to comment