Quick reminder, please

R

Robin Donald

Can someone please remind me of the name of the function which allows a
date and time to be compliled together and stored in a date/time field
or variable where the arguments are integer values of year, month, day,
etc.

i.e. it is the opposite of the DatePart stuff which breaks up a
date/time variable into integer parts.

To save my life, I cannot remember the name of this damned function.

Thank you

Robin Donald
 
K

KARL DEWEY

No function needed as long as it is entered in a standard format like --
12/25/05 1:35 pm
12/25/2005 1335
 
A

Albert D.Kallal

Returns a Variant (Date) for a specified year, month, and day.

Syntax

DateSerial(year, month, day)

The DateSerial function syntax has these named arguments:

Part Description
year Required; Integer. Number between 100 and 9999, inclusive,
or a
numeric expression.
month Required; Integer. Any numeric expression.
day Required; Integer. Any numeric expression.


Remarks

To specify a date, such as December 31, 1991, the range of numbers for each
DateSerial argument should be in the accepted range for the unit; that is,
1-31 for days and 1-12 for months. However, you can also specify relative
dates for each argument using any numeric expression that represents some
number of days, months, or years before or after a certain date.

The following example uses numeric expressions instead of absolute date
numbers. Here the DateSerial function returns a date that is the day before
the first day (1 - 1), two months before August (8 - 2), 10 years before
1990 (1990 - 10); in other words, May 31, 1980.

DateSerial(1990 - 10, 8 - 2, 1 - 1)
 
J

John Vinson

Can someone please remind me of the name of the function which allows a
date and time to be compliled together and stored in a date/time field
or variable where the arguments are integer values of year, month, day,
etc.

i.e. it is the opposite of the DatePart stuff which breaks up a
date/time variable into integer parts.

To save my life, I cannot remember the name of this damned function.

Thank you

Robin Donald

Two of them - DateSerial() and TimeSerial():

datetimevalue = DateSerial(year, month, day) + TimeSerial(hour,
minute, second)

John W. Vinson[MVP]
 
Top