Database Insert With Sequential 7 Days Plus AM / PM (Eight Rows)

I would like to insert dates into a database using a start date and end date. When entering the dates I would like the start date and each day after until the end date to be entered to each row in the database.

For instance, a conference starts on 11-11-2019 (Monday), it will end on 11-17-2019 (Sunday). The quirky part is that on the last date there will be an AM and PM. This would mean that Sunday would get two entries.

For Example:

Start Date: Nov 11, 2019
End Date: Nov 17, 2019

11-Nov-19 row column’s data…
12-Nov-19 row column’s data…
13-Nov-19 row column’s data…
14-Nov-19 row column’s data…
15-Nov-19 row column’s data…
16-Nov-19 row column’s data…
17-Nov-19 AM row column’s data…
17-Nov-19 PM row column’s data…

If there is data for the columns, it is printed in the appropriate row.
If not, then a note stating “Nothing Scheduled” will be place in the appropriate row and column.

Thanks to all the Wappler Wizards for any help you can offer.

Hi J. R.

Seems like you would do a series of inserts where the date value increment’s using the date formatter… start-date plus 1, plus 2, etc. And then again use the formatter to specify your am pm times for the last day.

—Ken

Yes sir! That’s right. I just haven’t had enough coffee as yet. I believe I might have to use the repeat inside the Action Steps.

I guess that I will enter the start date first, and then add a day to the start date with a core-repeat. However, I can’t think of how to stop the insert when it reaches the end date?

You definitely could do a repeat, but to me for this small number I wouldn’t…it just complicates things (albeit slightly.) I would just have 8 inserts, each with a different value calculated off the start date.

1 Like

Super idea… so I’d start with the start date, and then add a day eight times. Is that what you’re suggesting? – Sorry, seven times. Then add one more with the same date for the PM.

Yep. The 8th would probably need a time adjustment, which you can do by formatting the last date but instead of using placeholders for the time, specify the time you want to use.