date calculation

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

date calculation

DeMichele, Matthew
I have two date variables arranged as YYYYMM and YYYYYMMDD. The first
variable is date of birth and the second is date of admission to
treatment. I am trying to calculate age_at_admission, but am running
into trouble. Is this a possible calculation since SPSS calculates dates
as seconds since 10, 14, 1582?

Thank you for your help.

Matthew

Matthew DeMichele, PhD
Research Social Scientist
RTI International
Crime, Violence, and Justice Research Program
3040 Cornwallis Road, P.O. Box 12194
Research Triangle Park, NC 27709-2194
Telephone: (919) 541-6452
Fax: (919) 485-2680
Email: [hidden email]

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: date calculation

David Marso
Administrator
See the ALTER TYPE, CHAR.SUBSTR, DATE.MDY and variants and the DATEDIFF functions.
in the various documentation and help system.  There is also the DATETIME wizard which I have never bothered to use but might be useful if you are not literate in the various underlying syntax.

DeMichele, Matthew wrote
I have two date variables arranged as YYYYMM and YYYYYMMDD. The first
variable is date of birth and the second is date of admission to
treatment. I am trying to calculate age_at_admission, but am running
into trouble. Is this a possible calculation since SPSS calculates dates
as seconds since 10, 14, 1582?

Thank you for your help.

Matthew

Matthew DeMichele, PhD
Research Social Scientist
RTI International
Crime, Violence, and Justice Research Program
3040 Cornwallis Road, P.O. Box 12194
Research Triangle Park, NC 27709-2194
Telephone: (919) 541-6452
Fax: (919) 485-2680
Email: [hidden email]

=====================
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
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"