Step 5. Add a Virtual Column to Your Table

In this step, create a field Holiday Duration iiiHolDuration which will be used as a virtual column in the Holiday table.

Field Name

Field Description

Type

Length

Virtual

iiiHolDuration

Holiday Duration (virtual field)

Alpha

40

Yes

 

1.  Create the virtual column derivation in your table. It should bel defined to show the holiday duration like this:

2.  Make it a Code Fragment derivation. It needs to be derived when the record is read.

     Copy this code to create the field derivation code. Replace iii with your initials.

#iiiHolDuration := #iiiHolStartDate.Date.AsDisplayString( DDXXbMMMMMMMMMbCCYY ) + '  -  ' + #iiiHolEndDate.Date.AsDisplayString( DDXXbMMMMMMMMMbCCYY )
 

     Hint: Changing your Visual LANSA Editor font to a small size such as 8pt (see Options / Font) will make editing the above code much easier.