Hi everyone, I am trying to calculate age using Datediff, but the month and year for the interview and birth dates are listed as separate variables (i.e., imonth, iyear, birthmon, and birthyear). How can I combine these, so I can use Datediff? Best, Monique -------------------------------------------------------------- Associate Professor at Morgan State University/Guest Affiliate at Duke University co-PI/Texas State University/NASA, MSI TEN Teacher Education and Professional Development 1700 E. Cold Spring Lane Banneker Hall 211D Baltimore, Maryland 21251 Telephone: 443-885-1985 Fax: 443-885-8243 ------------------------------------------------------------ |
See FM on date functions (and formats). If you don't have a day, choose one
(e.g. 15). compute birthDate = date.dmy(birthday, birthmonth, birthyear). compute iDate = date.dmy(iday, imonth, imonth). formats birthDate iDate (adate10) /*or other preferred format*/. compute Age = DATEDIFF(iDate, birthDate, 'years'). execute. /PRogman [hidden email] wrote > Hi everyone, > > I am trying to calculate age using Datediff, but the month and year for > the > interview and birth dates are listed as separate variables (i.e., imonth, > iyear, birthmon, and birthyear). How can I combine these, so I can use > Datediff? > > > Best, > Monique > > -------------------------------------------------------------- > Marciea *Monique *McMillian, Ph.D. > <http://mcmillian.socialpsychology.org/> > Associate Professor at Morgan State University/Guest Affiliate at Duke > University > co-PI/Texas State University/NASA, MSI TEN > Teacher Education and Professional Development > 1700 E. Cold Spring Lane > Banneker Hall 211D > Baltimore, Maryland 21251 > Telephone: 443-885-1985 > Fax: 443-885-8243 > marciea.mcmillian@ > ------------------------------------------------------------ > > ===================== > To manage your subscription to SPSSX-L, send a message to > LISTSERV@.UGA > (not to SPSSX-L), with no body text except the > command. To leave the list, send the command > SIGNOFF SPSSX-L > For a list of commands to manage subscriptions, send the command > INFO REFCARD -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/ ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Thank you! -------------------------------------------------------------- Associate Professor at Morgan State University/Guest Affiliate at Duke University co-PI/Texas State University/NASA, MSI TEN Teacher Education and Professional Development 1700 E. Cold Spring Lane Banneker Hall 211D Baltimore, Maryland 21251 Telephone: 443-885-1985 Fax: 443-885-8243 ------------------------------------------------------------ On Mon, May 28, 2018 at 1:06 PM, PRogman <[hidden email]> wrote: See FM on date functions (and formats). If you don't have a day, choose one |
Free forum by Nabble | Edit this page |