Incremental Time Function

$IncTime has two modes. The first one has following parameters:

  1. (optional) Time Format. See date and time formats for details. Optional, default is HH:MM:SS
  2. (optional) Initial value*. Optional, default is 00:00:00.
  3. (optional) Step*. Integer. Optional, default is 1. Negative values are applicable.
  4. (optional) Step size. 'H', 'M'/'m' or 'S' for hour, minute or second. Optional, default is 'S'.
  5. (optional) Sequence border**, the function backs to the first value if the current value greater than this parameter. Time. Empty ("No cycle") is default.
  6. (optional) Reuse counter, integer, default is 1. The generator will return same value a few times if this parameter is positive.

In the second mode, the "Initial value" references to the maximum value of some column and will start after it. In this case, table name and column name should be provided instead of immediate value.

* - the function call (like $Pattern) is acceptable for 'Initial value' and 'Step' instead of constant. Performance warning: it can work a few times slowly for some cases.

** - applicable to positive step values only.

Examples

  • $IncTime() - same as $IncTime(HH:MM:SS,00:00:00,1,S). Output: 00:00:00,00:00:01,00:00:02,00:00:03,00:00:04,00:00:05,...
  • $IncTime(HHMM,1000,10,M) - start from 10:00, step is 10 minutes. Output: 1000,1010,1020,1030,1040,1050,1100,1110,...
  • $IncTime(HH:MM,03:00,-1,H) - decrement by 1 hour starting 03:00. Output: 03:00,02:00,01:00,00:00,23:00,22:00,21:00,...
  • $IncTime(HH:MM,03:00,1,H,09:00) - sequence limited by 09:00 value. Output: 03:00,04:00,05:00,06:00,07:00,08:00,09:00, 03:00,04:00,06:00,...
  • $IncTime(HH:MM,03:00,1,H,06:00,2) - limited by 09:00 value with each value twice usage. Output: 03:00,03:00,04:00,04:00,05:00,05:00,06:00,06:00, 03:00,03:00,...
  • $IncTime(HH:MM,$Pattern(@1),1,H) - uses column #1 as initial value, step is 1 hour.
  • $IncTime(HH:MM:SS,Activations,ActivationTime,1,S) - the program will use 'ActivationTime' of 'Activations' table + one second as initial value.