78 lines
5.1 KiB
HTML
78 lines
5.1 KiB
HTML
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE html
|
||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html lang="en-us" xml:lang="en-us">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta name="security" content="public" />
|
||
|
<meta name="Robots" content="index,follow" />
|
||
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
||
|
<meta name="DC.Type" content="concept" />
|
||
|
<meta name="DC.Title" content="Durations" />
|
||
|
<meta name="abstract" content="A duration is a number representing an interval of time. This topic introduces various types of durations." />
|
||
|
<meta name="description" content="A duration is a number representing an interval of time. This topic introduces various types of durations." />
|
||
|
<meta name="DC.subject" content="duration (Date, time, and timestamp)" />
|
||
|
<meta name="keywords" content="duration (Date, time, and timestamp)" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbafodttaopq.htm" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="rbafodttadur" />
|
||
|
<meta name="DC.Language" content="en-us" />
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
||
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
||
|
<title>Durations</title>
|
||
|
</head>
|
||
|
<body id="rbafodttadur"><a name="rbafodttadur"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Durations</h1>
|
||
|
<div><p>A <em>duration</em> is a number representing an interval of time.
|
||
|
This topic introduces various types of durations.</p>
|
||
|
<div class="section"><h4 class="sectiontitle">Date duration</h4><p>A
|
||
|
date duration represents a number of years, months, and days, expressed as
|
||
|
a DECIMAL(8,0) number. To be properly interpreted, the number must have the
|
||
|
format <em>yyyymmdd</em>, where <em>yyyy</em> represents the number of years, <em>mm</em> the
|
||
|
number of months, and <em>dd</em> the number of days. The result of subtracting
|
||
|
one date value from another, as in the expression HIREDATE - BRTHDATE, is
|
||
|
a date duration.</p>
|
||
|
</div>
|
||
|
<div class="section"><h4 class="sectiontitle">Labeled duration</h4><p>A
|
||
|
labeled duration represents a specific unit of time as expressed by a number
|
||
|
(which can be the result of an expression) used as an operand for one of the
|
||
|
seven duration built-in functions: %DURYEAR, %DURMONTH, %DURDAY, %DURHOUR,
|
||
|
%DURMINUTE, %DURSEC, or %DURMICSEC. The functions are for the duration of
|
||
|
year, month, day, hour, minute, second, and microsecond, respectively. The
|
||
|
number specified is converted as if it were assigned to a DECIMAL(15,0)
|
||
|
number. A labeled duration can only be used as an operand of an arithmetic
|
||
|
operator when the other operand is a value of data type *DATE, *TIME, or *TIMESTP.
|
||
|
Thus, the expression HIREDATE + %DURMONTH(2) + %DURDAY(14) is valid, whereas
|
||
|
the expression HIREDATE + (%DURMONTH(2) + %DURDAY(14)) is not. In both of
|
||
|
these expressions, the labeled durations are %DURMONTH(2) and %DURDAY(14).</p>
|
||
|
</div>
|
||
|
<div class="section"><h4 class="sectiontitle">Time duration</h4><p>A
|
||
|
time duration represents a number of hours, minutes, and seconds, expressed
|
||
|
as a DECIMAL(6,0) number. To be properly interpreted, the number must have
|
||
|
the format <em>hhmmss</em>, where <em>hh</em> represents the number of hours, <em>mm</em> the
|
||
|
number of minutes, and <em>ss</em> the number of seconds. The result of subtracting
|
||
|
one time value from another is a time duration.</p>
|
||
|
</div>
|
||
|
<div class="section"><h4 class="sectiontitle">Timestamp duration</h4><p>A
|
||
|
timestamp duration represents a number of years, months, days, hours, minutes,
|
||
|
seconds, and microseconds, expressed as a DECIMAL(20,6) number. To be properly
|
||
|
interpreted, the number must have the format <em>yyyymmddhhmmsszzzzzz,</em> where <em>yyyy,
|
||
|
mm, dd, hh, mm, ss, <span>and</span> zzzzzz</em> represent, respectively, the number
|
||
|
of years, months, days, hours, minutes, seconds, and microseconds. The result
|
||
|
of subtracting one timestamp value from another is a timestamp duration.</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafodttaopq.htm" title="Date, time, and timestamp values can be incremented, decremented, and subtracted. These operations might involve decimal numbers called durations. These topics include a definition of durations and a specification of the rules for performing arithmetic operations on date, time, and timestamp values.">Perform date, time, and timestamp arithmetic using the Open Query File (OPNQRYF) command</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|