
Dear member in the group
I would like to select records based on the month value from a date variable with the following format "mm/dd/yyyy". I would like to use something like this:
IF DC [1,2]="01" THEN MES="EN" IF DC [1,2]="02" THEN MES="FE" IF DC [1,2]="03" THEN MES="MA"
This is in epiinfo 6. DC is the date variable
I will appreciate your help.
Jose A. Farfan
Dr. Jose Arturo Farfan Ale Centro de Investigaciones Regionales "Dr. Hideyo Noguchi" Universidad Autónoma de Yucatán Av. Itzáes por 59, num. 490 Mérida, Yucatán, México 97000 Tel: (999) 923-22-74 (999) 924-57-55 Fax: (999) 923-61-20

Use the MONTH function - the functions for dates are explained in the help file. You don't have to worry about how to pull the month out of a date as we did in EpiInfo.
define nmon ## define mes __ nmon = month(dc) recode nmon to mes 1="EN" 2="FE" 3="MA" etc
Jamie
Jose wrote:
Dear member in the group
I would like to select records based on the month value from a date variable with the following format "mm/dd/yyyy". I would like to use something like this:
IF DC [1,2]="01" THEN MES="EN" IF DC [1,2]="02" THEN MES="FE" IF DC [1,2]="03" THEN MES="MA"
This is in epiinfo 6. DC is the date variable
I will appreciate your help.
Jose A. Farfan
Dr. Jose Arturo Farfan Ale Centro de Investigaciones Regionales "Dr. Hideyo Noguchi" Universidad Autónoma de Yucatán Av. Itzáes por 59, num. 490 Mérida, Yucatán, México 97000 Tel: (999) 923-22-74 (999) 924-57-55 Fax: (999) 923-61-20
EpiData-list mailing list EpiData-list@lists.umanitoba.ca http://lists.umanitoba.ca/mailman/listinfo/epidata-list
participants (1)
-
epidata-list@lists.umanitoba.ca