dateadd()

Ø

Øyvind Isaksen

Hi!

I need to add 1 day to a specific date.
The date have is stored in a variable called "DateOld". The value of the
variable have this syntax: mm.dd.yyyy.
The new date is the variable called "DateNew".

This is my code that dont work:

DateNew = DATEADD(d,1,DateOld)

What is wrong here??
I get this error message: Invalid procedure call or argument: 'DATEADD'


Regards,
Øyvind Isaksen
Norway
 
R

Ray at

The first issue is that the first argument needs to be a string, not an
empty variable, so you'd do:

DateNew = DateAdd("d", 1, DateOld)

But I don't think it'll work with that dot format. (Whoever started putting
dots in dates and phone numbers should be eliminated!) Replace the "." with
"/" before you use DateAdd.

Ray at work
 
K

Ken Schaefer

The function should be culture-aware. There are plenty of cultures that have
alternate numeric delimiters (eg . for thousands, and commas for decimals),
date delimiters, currency formats etc. VBScript doesn't care.

Cheers
Ken

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
: The first issue is that the first argument needs to be a string, not an
: empty variable, so you'd do:
:
: DateNew = DateAdd("d", 1, DateOld)
:
: But I don't think it'll work with that dot format. (Whoever started
putting
: dots in dates and phone numbers should be eliminated!) Replace the "."
with
: "/" before you use DateAdd.
:
: Ray at work
:
: : > Hi!
: >
: > I need to add 1 day to a specific date.
: > The date have is stored in a variable called "DateOld". The value of the
: > variable have this syntax: mm.dd.yyyy.
: > The new date is the variable called "DateNew".
: >
: > This is my code that dont work:
: >
: > DateNew = DATEADD(d,1,DateOld)
: >
: > What is wrong here??
: > I get this error message: Invalid procedure call or argument: 'DATEADD'
: >
: >
: > Regards,
: > Øyvind Isaksen
: > Norway
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top