
The errormessage 'error in IF expression: cannot apply opLT to boolean operands' occurs in the sample shown below if DISOL is missing, i.e. if a dato is compared with less-than or more-than to a missing value. It is a bug in EpiData, which will be fixed in a later version.
To avoid the errormessage, wrap the second if-statement in another if-statement that tests if DISOL is missing, e.g.:
IF (DISOL <> . ) THEN IF (DQUEST<DISOL) THEN HELP "etc.etc." .... ENDIF ENDIF
Regards Michael Bruus EpiData Association
----- Original Message ----- From: epidata-list@lists.umanitoba.ca To: epidata-list@lists.umanitoba.ca Sent: Friday, February 03, 2006 4:00 PM Subject: [EpiData-list] Consistency check on date field
There is a date (<DD/MM/YYYY>) field on my REC file; date entered here has to be before today.
Copy of the check block I wrote for it:
dquest AFTER ENTRY IF (DQUEST>TODAY) THEN HELP "Can't be after today!" TYPE=ERROR GOTO dquest CLEAR dquest ENDIF IF (DQUEST<DISOL) THEN HELP "Can't be before sampling date !" TYPE=ERROR GOTO dquest CLEAR dquest ENDIF END END
As a matter of fact, it works well, but error message each time an 'illegal value' is entered on the field: 'error in IF expression: cannot apply opLT to boolean operands'.
Only way not to see these error msgs each record: I unchecked the 'Show errors that occur in calculations in the check file during data entry'.
Someone has an idea? What did I make wrong?
Thanks Gilles