dateserial question

Results 1 to 2 of 2

Thread: dateserial question

  1. #1
    Join Date
    Dec 1969

    Default dateserial question

    hello<BR><BR>EndOfMonth = DateSerial(2001, 2 + 1, 0)<BR><BR>how come that this gives the last possible day in a month?<BR><BR>I&#039;ve searched the net and couldn&#039;t find any decription about setting the day value to 0 to get the endofmonth day

  2. #2
    Join Date
    Dec 1969

    Default RE: dateserial question

    This is in the Microsoft documentation...<BR><BR>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.<BR><BR>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.<BR><BR>DateSerial(1990 - 10, 8 - 2, 1 - 1)<BR><BR><BR><BR>Gavin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts