I have 2 tables; Parent = Weekly Time Cards, Child = Daily Time Cards. I need a button on Weekly Time Cards to create 7 Daily Time Cards for the week.

• 0
• Question
• Updated 2 years ago
Each "Daily Time Card" should be based off field [Start of Week Date] ; first "Daily Time Card" using that date to fill out Child field [ Time Card Date} and then the rest of the week assigned to the correct dates [Start of Week Date] +1 thru +6.   eg I create a Week Start Date entry 1/8/2017 and then create 7 Daily Time Cards for 1/8/2017, 1/9/2017, 1/10/2017, 1/11/2017, 1/12/2017,1/13/2017,1/14/2017 associated with the Weekly Time Card "1/8/2017"

molsonite, Champion

• 10 Points

Posted 2 years ago

• 0

QuickBaseCoach App Dev./Training, Champion

• 65,542 Points
I suggest that you create a Master Timecard with 7 records. Each of the 7 will have a field for the day number of the week. Number then in that field from 1 to 7.

Then look up the start day of the week from the parent record and use a date formula to calculate which day of the week each of the five hour.

Then use the copy master detail wizard to have QuickBase make you a button to copy the children from that particular Master Timecard record.

molsonite, Champion

• 10 Points
Okay, I understand the Master Timecard with 7 records. And I understand the Copy Master Detail Wizard to create the button. Got that, that works great.
But the formula part of the days is where you lost me. I know I create a date formula. But where's is it going (the create button?) and how can I write the formula to recognize the increasing date requirement. Child entry #1 - Day 1 = Start of Week,
Child Entry #2 - Day 2= Start of Week +1, etc.. thru Day 7 = Start of Week +6

QuickBaseCoach App Dev./Training, Champion

• 65,542 Points
When you build your master template record, you will build it with a field to enter the day number of the week, and you will hand edit the 7 child template records to enter the numbers from 1 to 7 on the 7 records.  Then take that field off the form or hide it by a form rule or make it read only for regular users.  Then use that field on your date formula.

molsonite, Champion

• 10 Points
so my formula for the new Date field in the child table would be something like
[start of week date] + Days [Day of the week = new manual field]
and manually propagate the Day of the week field 7 times.
Then rerun the Wizard to Create the button

QuickBaseCoach App Dev./Training, Champion

• 65,542 Points
yes, but you probably have to subtract 1 day, unless you number your days from 0 to 6.

[start of week date] + Days([Day of the week = new manual field]-1)

molsonite, Champion

• 10 Points
Yep, just realized that. Thank you very much.