The calculation variables of IR can store numbers, but no strings or dates.
In case you want to report e.g. the latest result modification of a sequence you may want to report only a single time stamp.
Here's a possible solution:
- Add a result table to your template
- Sort your result table by Injection_LastModifiedDate (ascending)
- The function first(Injection_LastModifiedDate) will return the time stamp of interest. For validation purposes you should show this value in a column
- To report this number outside of a table you could store the difference of the latest modification time stamp and any other globally availabl time stamp (e.g. the sequence acquisition date). This number will be added to your reference time stamp again in the output field.
Use the following syntax to store the time difference in seconds:
=DateDiff(DateInterval.Second,Sequence_AcquiredDate,first(Injection_LastModifiedDate))
- Save this expression result in a variable
- Hide the table or the columns you do not like to show
- The following syntax is used to add the difference again in the output field. Mind the formatting to your local time zone! :
=FORMATDATETIME
(SYSTEM.TIMEZONE.CURRENTTIMEZONE.TOLOCALTIME(
(DateAdd(DateInterval.Second,(LastChangeSinceSeqStart),Sequence_AcquiredDate))),0)
The attached template could be used to create a custom composite group for re-use with your templates.
(Template generated with OpenLAB CDS A.01.04)
(originally posted in OpenLAB Forum: https://zohodiscussions.com/openlabcdsforum#Topic/68030000000147003
2014 November 13 by betrich)