Dear Hans,
Thank you for your reply but I also saw this mistakes.
Many thanks.
--Pièce jointe du message transmise--
From: epidata-list@lists.umanitoba.ca
To: epidata-list@lists.umanitoba.ca
Date: Sat, 8 Oct 2011 19:24:19 +0200Envoyer
Subject: Re: [EpiData-list] How to calculate age
Dear Sophie:
You cannot have "BEFORE ENTRY" in a "NOENTER" field because no command
in that field can ever be executed.
Better choose an "AFTER ENTRY" block in the field in which you added the
last component that is needed to calculate the age, i.e., in the field DoB.
To this end you may try:
Your QES file:
age ##.#
recdate <Today-dmy>
dob <dd/mm/yyyy>
other _
Your CHK file:
age
NOENTER
END
dob
MUSTENTER
AFTER ENTRY
age=(recdate-dob)/365.25
END
END
Regards,
Hans
On 20:59, epidata-list@lists.umanitoba.ca wrote:
Hello everybody,
I am trying to write a syntax in .chk file to automatically calculate age during the data entry from the today's date and the DoB.The syntax is :
" ddn
MUSTENTER
END
age
NOENTER
BEFORE ENTRY
let age=ound(int((date-ddn)/(365.25))))
END
END"
The variables are coded in the .qes file as follows:
{DATE} automatique<Today-dmy>{DDN} DATE DE NAISSANCE (DATE OF BIRTH)<dd/mm/yyyy>{AGE} automatique ###
What's wrong with my syntax?
Sincerely hope you can help me.
Regards,
Sophie PilleronPhD student.
--
Hans L Rieder, MD, MPH
Jetzikofenstr 12
3038 Kirchlindach
Switzerland
Tel: +41 31 829 4577
Mob: +41 79 321 9122
Web:
http://www.tbrieder.org
--Pièce jointe du message transmise--
From: epidata-list@lists.umanitoba.ca
To: epidata-list@lists.umanitoba.ca
Date: Sat, 8 Oct 2011 20:04:14 +0200
Subject: [EpiData-list] How to calculate age
Many thanks Jamie. It works now. I will never have found out my mistake without your support. Thanks again.
Sophie.
--Pièce jointe du message transmise--
From: epidata-list@lists.umanitoba.ca
To: epidata-list@lists.umanitoba.ca
Date: Sat, 8 Oct 2011 16:41:29 +0200
Subject: [EpiData-list] How to calculate age
Hello everybody,
I am trying to write a syntax in .chk file to automatically calculate age during the data entry from the today's date and the DoB.The syntax is :
" ddn
MUSTENTER
END
age
NOENTER
BEFORE ENTRY
let age=(round(int((date-ddn)/(365.25))))
END
END"
The variables are coded in the .qes file as follows:
{DATE} automatique <Today-dmy>{DDN} DATE DE NAISSANCE (DATE OF BIRTH) <dd/mm/yyyy>{AGE} automatique ###
What's wrong with my syntax?
Sincerely hope you can help me.
Regards,
Sophie PilleronPhD student.
--Pièce jointe du message transmise--
From: epidata-list@lists.umanitoba.ca
To: epidata-list@lists.umanitoba.ca
Date: Sat, 8 Oct 2011 12:42:47 -0400
Subject: Re: [EpiData-list] How to calculate age
You cannot have a field named DATE because that is the name of a function.
EpiData doesn't complain when you do this, but you cannot use any function names as field names.
Jamie
On 2011-10-08, at 10:41 AM, epidata-list@lists.umanitoba.ca wrote:
> let age=(round(int((date-ddn)/(365.25))))