Question on dates

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

Question on dates

Kevin L-3
Hello,

I'm new to SPSS and am glad I've found this forum. Currently trying out
PASW18.

Some initial questions:
1. How do we get the software to auto insert the current date (date2)?
2. How do I get SPSS to calculate the difference between date2 and date1,
and get an answer in years and months if possible?

Thank you.
kevin.

=====================
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: Question on dates

Oliver, Richard
compute todaydate=$time.
formats todaydate (adate10).
compute yeardif=datediff(date2, date1, "years").
compute monthdif=datediff(date2, date1, "months").

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Kevin L
Sent: Sunday, October 18, 2009 9:51 AM
To: [hidden email]
Subject: Question on dates

Hello,

I'm new to SPSS and am glad I've found this forum. Currently trying out
PASW18.

Some initial questions:
1. How do we get the software to auto insert the current date (date2)?
2. How do I get SPSS to calculate the difference between date2 and date1,
and get an answer in years and months if possible?

Thank you.
kevin.

=====================
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

=====================
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: Question on dates

Bruce Weaver
Administrator
In reply to this post by Kevin L-3
Kevin L-3 wrote
Hello,

I'm new to SPSS and am glad I've found this forum. Currently trying out
PASW18.

Some initial questions:
1. How do we get the software to auto insert the current date (date2)?
2. How do I get SPSS to calculate the difference between date2 and date1,
and get an answer in years and months if possible?

Thank you.
kevin.
Regarding number 2, Richard showed how to get the difference in years, and how to get the same difference in months.  Is that what you meant?  Or do you want 30 months reported as Years=2 and Months=6, for example?

--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).