1cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?>
2cdf0e10cSrcweir
3cdf0e10cSrcweir
4*d33d0967SAndrew Rist<!--***********************************************************
5cdf0e10cSrcweir *
6*d33d0967SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
7*d33d0967SAndrew Rist * or more contributor license agreements.  See the NOTICE file
8*d33d0967SAndrew Rist * distributed with this work for additional information
9*d33d0967SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
10*d33d0967SAndrew Rist * to you under the Apache License, Version 2.0 (the
11*d33d0967SAndrew Rist * "License"); you may not use this file except in compliance
12*d33d0967SAndrew Rist * with the License.  You may obtain a copy of the License at
13*d33d0967SAndrew Rist *
14*d33d0967SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
15*d33d0967SAndrew Rist *
16*d33d0967SAndrew Rist * Unless required by applicable law or agreed to in writing,
17*d33d0967SAndrew Rist * software distributed under the License is distributed on an
18*d33d0967SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19*d33d0967SAndrew Rist * KIND, either express or implied.  See the License for the
20*d33d0967SAndrew Rist * specific language governing permissions and limitations
21*d33d0967SAndrew Rist * under the License.
22*d33d0967SAndrew Rist *
23*d33d0967SAndrew Rist ***********************************************************-->
24*d33d0967SAndrew Rist
25*d33d0967SAndrew Rist
26cdf0e10cSrcweir
27cdf0e10cSrcweir<helpdocument version="1.0">
28cdf0e10cSrcweir<meta>
29cdf0e10cSrcweir<topic id="textsbasicshared03030110xhp" indexer="include" status="PUBLISH">
30cdf0e10cSrcweir<title id="tit" xml-lang="en-US">DateAdd Function [Runtime]</title>
31cdf0e10cSrcweir<filename>/text/sbasic/shared/03030110.xhp</filename>
32cdf0e10cSrcweir</topic>
33cdf0e10cSrcweir<history>
34cdf0e10cSrcweir<created date="2005-04-25T12:44:45">DateAdd</created>
35cdf0e10cSrcweir<lastedited date="2005-04-26T10:20:22">checked</lastedited>
36cdf0e10cSrcweir</history>
37cdf0e10cSrcweir</meta>
38cdf0e10cSrcweir<body>
39cdf0e10cSrcweir<section id="dateadd">
40cdf0e10cSrcweir<bookmark xml-lang="en-US" branch="index" id="bm_id6269417"><bookmark_value>DateAdd function</bookmark_value>
41cdf0e10cSrcweir</bookmark>
42cdf0e10cSrcweir<paragraph role="heading" id="par_idN10548" xml-lang="en-US" level="1" l10n="NEW"><link href="text/sbasic/shared/03030110.xhp">DateAdd Function [Runtime]</link></paragraph>
43cdf0e10cSrcweir<paragraph role="paragraph" id="par_idN10558" xml-lang="en-US" l10n="NEW">Adds a date interval to a given date a number of times and returns the resulting date.</paragraph>
44cdf0e10cSrcweir</section>
45cdf0e10cSrcweir<paragraph role="heading" id="par_idN1055B" xml-lang="en-US" level="2" l10n="NEW">Syntax:</paragraph>
46cdf0e10cSrcweir<paragraph role="paragraph" id="par_idN1055F" xml-lang="en-US" l10n="NEW">DateAdd (Add, Count, Date)</paragraph>
47cdf0e10cSrcweir<paragraph role="heading" id="par_idN1061E" xml-lang="en-US" level="2" l10n="NEW">Return value:</paragraph>
48cdf0e10cSrcweir<paragraph role="paragraph" id="par_idN10622" xml-lang="en-US" l10n="NEW">A Variant containing a date.</paragraph>
49cdf0e10cSrcweir<paragraph role="heading" id="par_idN10625" xml-lang="en-US" level="2" l10n="NEW">Parameters:</paragraph>
50cdf0e10cSrcweir<paragraph role="paragraph" id="par_idN10629" xml-lang="en-US" l10n="NEW">Add - A string expression from the following table, specifying the date interval.</paragraph>
51cdf0e10cSrcweir<section id="datetable">
52cdf0e10cSrcweir<table id="tbl_id7568285">
53cdf0e10cSrcweir<tablerow>
54cdf0e10cSrcweir<tablecell colspan="" rowspan="">
55cdf0e10cSrcweir<paragraph role="tablehead" id="par_idN10636" xml-lang="en-US" l10n="NEW">Add (string value)</paragraph>
56cdf0e10cSrcweir</tablecell>
57cdf0e10cSrcweir<tablecell colspan="" rowspan="">
58cdf0e10cSrcweir<paragraph role="tablehead" id="par_idN1063C" xml-lang="en-US" l10n="NEW">Explanation</paragraph>
59cdf0e10cSrcweir</tablecell>
60cdf0e10cSrcweir</tablerow>
61cdf0e10cSrcweir<tablerow>
62cdf0e10cSrcweir<tablecell colspan="" rowspan="">
63cdf0e10cSrcweir<paragraph role="tablecontent" id="par_idN10643" xml-lang="en-US" l10n="NEW">yyyy</paragraph>
64cdf0e10cSrcweir</tablecell>
65cdf0e10cSrcweir<tablecell colspan="" rowspan="">
66cdf0e10cSrcweir<paragraph role="tablecontent" id="par_idN10649" xml-lang="en-US" l10n="NEW">Year</paragraph>
67cdf0e10cSrcweir</tablecell>
68cdf0e10cSrcweir</tablerow>
69cdf0e10cSrcweir<tablerow>
70cdf0e10cSrcweir<tablecell colspan="" rowspan="">
71cdf0e10cSrcweir<paragraph role="tablecontent" id="par_idN10650" xml-lang="en-US" l10n="NEW">q</paragraph>
72cdf0e10cSrcweir</tablecell>
73cdf0e10cSrcweir<tablecell colspan="" rowspan="">
74cdf0e10cSrcweir<paragraph role="tablecontent" id="par_idN10656" xml-lang="en-US" l10n="NEW">Quarter</paragraph>
75cdf0e10cSrcweir</tablecell>
76cdf0e10cSrcweir</tablerow>
77cdf0e10cSrcweir<tablerow>
78cdf0e10cSrcweir<tablecell colspan="" rowspan="">
79cdf0e10cSrcweir<paragraph role="tablecontent" id="par_idN1065D" xml-lang="en-US" l10n="NEW">m</paragraph>
80cdf0e10cSrcweir</tablecell>
81cdf0e10cSrcweir<tablecell colspan="" rowspan="">
82cdf0e10cSrcweir<paragraph role="tablecontent" id="par_idN10663" xml-lang="en-US" l10n="NEW">Month</paragraph>
83cdf0e10cSrcweir</tablecell>
84cdf0e10cSrcweir</tablerow>
85cdf0e10cSrcweir<tablerow>
86cdf0e10cSrcweir<tablecell colspan="" rowspan="">
87cdf0e10cSrcweir<paragraph role="tablecontent" id="par_idN1066A" xml-lang="en-US" l10n="NEW">y</paragraph>
88cdf0e10cSrcweir</tablecell>
89cdf0e10cSrcweir<tablecell colspan="" rowspan="">
90cdf0e10cSrcweir<paragraph role="tablecontent" id="par_idN10670" xml-lang="en-US" l10n="NEW">Day of year</paragraph>
91cdf0e10cSrcweir</tablecell>
92cdf0e10cSrcweir</tablerow>
93cdf0e10cSrcweir<tablerow>
94cdf0e10cSrcweir<tablecell colspan="" rowspan="">
95cdf0e10cSrcweir<paragraph role="tablecontent" id="par_idN10677" xml-lang="en-US" l10n="NEW">w</paragraph>
96cdf0e10cSrcweir</tablecell>
97cdf0e10cSrcweir<tablecell colspan="" rowspan="">
98cdf0e10cSrcweir<paragraph role="tablecontent" id="par_idN1067D" xml-lang="en-US" l10n="NEW">Weekday</paragraph>
99cdf0e10cSrcweir</tablecell>
100cdf0e10cSrcweir</tablerow>
101cdf0e10cSrcweir<tablerow>
102cdf0e10cSrcweir<tablecell colspan="" rowspan="">
103cdf0e10cSrcweir<paragraph role="tablecontent" id="par_idN10684" xml-lang="en-US" l10n="NEW">ww</paragraph>
104cdf0e10cSrcweir</tablecell>
105cdf0e10cSrcweir<tablecell colspan="" rowspan="">
106cdf0e10cSrcweir<paragraph role="tablecontent" id="par_idN1068A" xml-lang="en-US" l10n="NEW">Week of year</paragraph>
107cdf0e10cSrcweir</tablecell>
108cdf0e10cSrcweir</tablerow>
109cdf0e10cSrcweir<tablerow>
110cdf0e10cSrcweir<tablecell colspan="" rowspan="">
111cdf0e10cSrcweir<paragraph role="tablecontent" id="par_idN10691" xml-lang="en-US" l10n="NEW">d</paragraph>
112cdf0e10cSrcweir</tablecell>
113cdf0e10cSrcweir<tablecell colspan="" rowspan="">
114cdf0e10cSrcweir<paragraph role="tablecontent" id="par_idN10697" xml-lang="en-US" l10n="NEW">Day</paragraph>
115cdf0e10cSrcweir</tablecell>
116cdf0e10cSrcweir</tablerow>
117cdf0e10cSrcweir<tablerow>
118cdf0e10cSrcweir<tablecell colspan="" rowspan="">
119cdf0e10cSrcweir<paragraph role="tablecontent" id="par_idN1069E" xml-lang="en-US" l10n="NEW">h</paragraph>
120cdf0e10cSrcweir</tablecell>
121cdf0e10cSrcweir<tablecell colspan="" rowspan="">
122cdf0e10cSrcweir<paragraph role="tablecontent" id="par_idN106A4" xml-lang="en-US" l10n="NEW">Hour</paragraph>
123cdf0e10cSrcweir</tablecell>
124cdf0e10cSrcweir</tablerow>
125cdf0e10cSrcweir<tablerow>
126cdf0e10cSrcweir<tablecell colspan="" rowspan="">
127cdf0e10cSrcweir<paragraph role="tablecontent" id="par_idN106AB" xml-lang="en-US" l10n="NEW">n</paragraph>
128cdf0e10cSrcweir</tablecell>
129cdf0e10cSrcweir<tablecell colspan="" rowspan="">
130cdf0e10cSrcweir<paragraph role="tablecontent" id="par_idN106B1" xml-lang="en-US" l10n="NEW">Minute</paragraph>
131cdf0e10cSrcweir</tablecell>
132cdf0e10cSrcweir</tablerow>
133cdf0e10cSrcweir<tablerow>
134cdf0e10cSrcweir<tablecell colspan="" rowspan="">
135cdf0e10cSrcweir<paragraph role="tablecontent" id="par_idN106B8" xml-lang="en-US" l10n="NEW">s</paragraph>
136cdf0e10cSrcweir</tablecell>
137cdf0e10cSrcweir<tablecell colspan="" rowspan="">
138cdf0e10cSrcweir<paragraph role="tablecontent" id="par_idN106BE" xml-lang="en-US" l10n="NEW">Second</paragraph>
139cdf0e10cSrcweir</tablecell>
140cdf0e10cSrcweir</tablerow>
141cdf0e10cSrcweir</table>
142cdf0e10cSrcweir
143cdf0e10cSrcweir</section>
144cdf0e10cSrcweir<paragraph role="paragraph" id="par_idN106C1" xml-lang="en-US" l10n="NEW">Count - A numerical expression specifying how often the Add interval will be added (Count is positive) or subtracted (Count is negative).</paragraph>
145cdf0e10cSrcweir<paragraph role="paragraph" id="par_idN106C4" xml-lang="en-US" l10n="NEW">Date - A given date or the name of a Variant variable containing a date. The Add value will be added Count times to this value.</paragraph>
146cdf0e10cSrcweir<paragraph role="heading" id="par_idN106C7" xml-lang="en-US" level="2" l10n="NEW">Example:</paragraph>
147cdf0e10cSrcweir<paragraph role="code" id="par_idN106CB" xml-lang="en-US" l10n="NEW">Sub example_dateadd</paragraph>
148cdf0e10cSrcweir<paragraph role="code" id="par_idN106CE" xml-lang="en-US" l10n="NEW">msgbox DateAdd("m", 1, "1/31/2004") &amp;" - "&amp; DateAdd("m", 1, "1/31/2005")</paragraph>
149cdf0e10cSrcweir<paragraph role="code" id="par_idN106D1" xml-lang="en-US" l10n="NEW">End Sub</paragraph>
150cdf0e10cSrcweir</body>
151cdf0e10cSrcweir</helpdocument>
152