DateSerial function

G

Guest

I tried using, in form design view, a DateSerial funtion to caculate a future
date which is ten days later from a starting date of 4/2/05. I set the
format property for the Startdate text box to short date and the control
source property for the future date to the following:
=DateSerial(year([StrartDate]), month([StartDate]), day([StartDate]) + 10).
Somehow I receive a date of 12/9/1899 as the FutureDate. I use MS Office
Professional Edition 2003. Is this related to the year 2000 problem? I'll
appreciate your help!
 
P

Paul Overway

Use of DateSerial is fine...the problem is a typo. It should be...

=DateSerial(year([StartDate]), month([StartDate]), day([StartDate]) + 10)

Notice there was an extra R in the parameter for Year.

--
Paul Overway
Logico Solutions
http://www.logico-solutions.com


Klatuu said:
Wrong function, use:
=Dateadd("d",10, [StartDate])

Mon said:
I tried using, in form design view, a DateSerial funtion to caculate a
future
date which is ten days later from a starting date of 4/2/05. I set the
format property for the Startdate text box to short date and the control
source property for the future date to the following:
=DateSerial(year([StrartDate]), month([StartDate]), day([StartDate]) +
10).
Somehow I receive a date of 12/9/1899 as the FutureDate. I use MS Office
Professional Edition 2003. Is this related to the year 2000 problem?
I'll
appreciate your help!
 
G

Guest

Okay, but I still think the Dateadd is more appropriate here

Paul Overway said:
Use of DateSerial is fine...the problem is a typo. It should be...

=DateSerial(year([StartDate]), month([StartDate]), day([StartDate]) + 10)

Notice there was an extra R in the parameter for Year.

--
Paul Overway
Logico Solutions
http://www.logico-solutions.com


Klatuu said:
Wrong function, use:
=Dateadd("d",10, [StartDate])

Mon said:
I tried using, in form design view, a DateSerial funtion to caculate a
future
date which is ten days later from a starting date of 4/2/05. I set the
format property for the Startdate text box to short date and the control
source property for the future date to the following:
=DateSerial(year([StrartDate]), month([StartDate]), day([StartDate]) +
10).
Somehow I receive a date of 12/9/1899 as the FutureDate. I use MS Office
Professional Edition 2003. Is this related to the year 2000 problem?
I'll
appreciate your help!
 
P

Paul Overway

Perhaps...and less typing for sure...but either will work. More than one
way to skin a cat.

--
Paul Overway
Logico Solutions
http://www.logico-solutions.com


Klatuu said:
Okay, but I still think the Dateadd is more appropriate here

Paul Overway said:
Use of DateSerial is fine...the problem is a typo. It should be...

=DateSerial(year([StartDate]), month([StartDate]), day([StartDate]) + 10)

Notice there was an extra R in the parameter for Year.

--
Paul Overway
Logico Solutions
http://www.logico-solutions.com


Klatuu said:
Wrong function, use:
=Dateadd("d",10, [StartDate])

:

I tried using, in form design view, a DateSerial funtion to caculate a
future
date which is ten days later from a starting date of 4/2/05. I set
the
format property for the Startdate text box to short date and the
control
source property for the future date to the following:
=DateSerial(year([StrartDate]), month([StartDate]), day([StartDate]) +
10).
Somehow I receive a date of 12/9/1899 as the FutureDate. I use MS
Office
Professional Edition 2003. Is this related to the year 2000 problem?
I'll
appreciate your help!
 
G

Guest

Agreed, and may there always be plenty of cats available. I don't want to
have to get a "real" job. That is one of the things I most like about this
site is looking at all the ways to do the same thing. It is a learning
experience.

IMHO, the very best coders write very simple straightforward code. I was
told many years ago by the guy who tought me programming that you can tell
how long a person has been coding based on the code. He said the seasoned
expert's code will look suprisingly like a beginner's code. The beginner is
just trying to make it work and doesn't yet know all the cute tricks. As he
learns, he trys out exoctic complex techniques that work, but are difficult
to read and debug. After a while of trying to debug what he wrote 6 months
ago, he goes back toward the simplistic. His code, then, will look like the
beginner, but cleaner and no work arounds where he doesn't really know how to
tackle the problems.

Paul Overway said:
Perhaps...and less typing for sure...but either will work. More than one
way to skin a cat.

--
Paul Overway
Logico Solutions
http://www.logico-solutions.com


Klatuu said:
Okay, but I still think the Dateadd is more appropriate here

Paul Overway said:
Use of DateSerial is fine...the problem is a typo. It should be...

=DateSerial(year([StartDate]), month([StartDate]), day([StartDate]) + 10)

Notice there was an extra R in the parameter for Year.

--
Paul Overway
Logico Solutions
http://www.logico-solutions.com


Wrong function, use:
=Dateadd("d",10, [StartDate])

:

I tried using, in form design view, a DateSerial funtion to caculate a
future
date which is ten days later from a starting date of 4/2/05. I set
the
format property for the Startdate text box to short date and the
control
source property for the future date to the following:
=DateSerial(year([StrartDate]), month([StartDate]), day([StartDate]) +
10).
Somehow I receive a date of 12/9/1899 as the FutureDate. I use MS
Office
Professional Edition 2003. Is this related to the year 2000 problem?
I'll
appreciate your help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top