Date: Thu, 18 Feb 2010 12:23:58 -0500
Reply-To: Art@DrKendall.org
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Art Kendall <Art@DrKendall.org>
Organization: Social Research Consultants
Subject: Re: Date calculation question
In-Reply-To: <D7C99E2A08E97C46AAC1CFBF20D2FB9A0358D7B98F@EXCNYSM95BAFP.nysemail.nyenet>
Content-type: text/html; charset=ISO-8859-1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
{snipped from <help><br>
<title>Date Differences</title>
<!--File syn_date_and_time_date_differences.htm--><!--Generated with Help Tools v. 4.5.2x
-->
<link rel="stylesheet" href="help-core.css">
<link rel="stylesheet" href="help-loc.css">
<link rel="stylesheet" href="help-base.css">
<script type="text/javascript" src="ms-its:mainhelp.chm::/chmhelp.js"></script>
<h1>Date Differences </h1>
<div class="keywords">date and time functions,date and time
functions,date and time functions</div>
<div class="keywords">difference between dates,difference between
dates,difference between dates</div>
<div class="keywords">DATEDIFF function,DATEDIFF function,DATEDIFF
function</div>
<div class="keywords">functions,functions,functions</div>
<div class="keywords">date and time,date and time,date and time</div>
<p class="body">The <span class="syntax">DATEDIFF</span> function
calculates the difference between two date values and returns an
integer (with any fraction component truncated) in the specified
date/time units. The general form of the expression is</p>
<pre class="syntaxblock">DATEDIFF(datetime2, datetime1, “unit”).</pre>
<p class="body">where <span class="name">datetime2</span> and <span
class="name">datetime1</span> are both date or time format variables
(or numeric values that represent valid date/time values), and “unit”
is one of the following string literal values, enclosed in quotes:</p>
<p class="bullet">• Years</p>
<p class="bullet">• Quarters</p>
<p class="bullet">• Months</p>
<p class="bullet">• Weeks</p>
<p class="bullet">• Days</p>
<p class="bullet">• Hours</p>
There is more details under <help><br>
<br>
Art Kendall<br>
Social Research Consultants<br>
<br>
On 2/18/2010 12:08 PM, FernandezLanier, Adriana (DCJS) wrote:
<blockquote
cite="mid:D7C99E2A08E97C46AAC1CFBF20D2FB9A0358D7B98F@EXCNYSM95BAFP.nysemail.nyenet"
type="cite">
<meta http-equiv="Content-Type"
content="text/html; charset=ISO-8859-1">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Bookman Old Style";
panose-1:2 5 6 4 5 5 5 2 2 4;}
@font-face
{font-family:Webdings;
panose-1:5 3 1 2 1 5 9 6 7 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Bookman Old Style","serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
-->
</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="Section1">
<p class="MsoNormal"><span
style="font-family: "Bookman Old Style","serif";">Good afternoon. I
have two date variables—time released and time enrolled. They are both
in SPPS date format (e.g., 07-Mar-2008). Is there a more direct way to
calculate the time difference between the two variables besides using
the extraction format to create year, month, and day which would then
allow me to use yrmoda function. For example, I would like to calculate
the time difference between 07-Mar-2008 and 25-Aug-2006. Any
suggestions would be appreciated. Thanks, Adriana <o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-family: "Bookman Old Style","serif";"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size: 24pt; font-family: Webdings; color: green;">P</span><span
style="font-size: 7.5pt; color: green;"> Please consider the
environment before printing this e-mail.<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br>
<hr>
<font color="Gray" face="Arial" size="1">This e-mail, including any
attachments, may be confidential, privileged or otherwise legally
protected. It is intended only for the addressee. If you received this
e-mail in error or from someone who was not authorized to send it to
you, do not disseminate, copy or otherwise use this e-mail or its
attachments. Please notify the sender immediately by reply e-mail and
delete the e-mail from your system.<br>
</font>
</blockquote>
</body>
</html>
=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (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
|