Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2013
    Posts
    1

    Unanswered: Make multiple records based on occurance

    Hi guys,

    I am making a database that has to do with Preventive maintenance. Everything is going good and I came to a problem. There are recurring events. Some are weekly monthly quarterly etc all the way to 5 years. When I put in the task and a start date and he occurrence I want to create multiple records up to a certain time frame say for the next 5 years. What would be a way to do that??


    Thank you

  2. #2
    Join Date
    Apr 2011
    Posts
    34
    Well, if you are not familiar with VBA, you may have to change that and start reading.
    Very roughly in a form of pseudo-code I would consider doing something like:
    Code:
    For aDate = StartDate to aDate <= EndDate
    	If (aDate is acceptable) then
    		SQLInsert Event with aDate
    	else
    		handle problem
    	aDate=aDate + RecuringStep
    For each aDate, yo would have to check if it is ok. Like is week end acceptable? Is there a conflict with another scheduled maintenance activity?
    Also you may want to tag somehow that recuring activity so that if a change must be made, it can be apply to some or all of the activities previously recorded.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •