Archive for the ‘Uncategorized’ Category

How to subtract a number of working days from a date field

Tuesday, January 16th, 2018

Version:  (DataEase DOS or Windows) and Ffenics

The first step is to deduct the number of days to the original date.
OrigDate – WorkingDays
Next the number of weekends need to be derived, simply by dividing the number of WorkingDays by the number of working days in a week, rounded down to get rid of decimal place and then multiplying that by the number of days in weekend.
floor ( WorkingDays / 5 ) * 2
Finally, we need to ensure that the resulting date is not a weekend. Do this by getting the remainder of the WorkingDays divided by the number of days in a week, deducting that from the original date and if that is a weekend, include the number of days in a weekend into the calculation.
if ( weekday ( OrigDate – mod ( WorkingDays , 5 ) ) > 5 , 2  , 0  )
The completed field derivation is:
OrigDate – WorkingDays –
floor ( WorkingDays / 5 ) * 2 )
if ( weekday ( OrigDate – mod ( WorkingDays , 5 ) ) > 5 , 2 , 0 )

 

DataEase and Ffenics – How to Export to a Variable Filename

Tuesday, May 26th, 2015

TestVariableCTRL
Define Global “gFilename” ;   Text 255 .

GFilename := data-entry EnterFilename .

run procedure “TestVariableExp2” .

TestVariableExp2.
define global “GFilename”   Text 255 .

for COUNTRYSETUP ;

list records
CountryCode in order ;
Country .
end
export to GFilename .
CountryCode,Country
.items
@f[1,1],@f[1,2]
.end

DataEase 7 User Guides

Tuesday, December 23rd, 2014

For copies of  DataEase 7.2 Designer’s Guide and Help File, please email us at info@dataconsultancy.co.uk