469,568 Members | 1,720 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,568 developers. It's quick & easy.

dateadd()

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
Jul 19 '05 #1
4 9885
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

"Řyvind Isaksen" <oy****@webressurs.no> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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

Jul 19 '05 #2
DateNew=DateAdd("d",1,DateOld)

"Řyvind Isaksen" <oy****@webressurs.no> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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

Jul 19 '05 #3
Tom B wrote on 17 okt 2003 in microsoft.public.inetserver.asp.general:
DateNew=DateAdd("d",1,DateOld)


So true ;-)

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #4
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
news:uW**************@TK2MSFTNGP12.phx.gbl...
: 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
:
: "Řyvind Isaksen" <oy****@webressurs.no> wrote in message
: news:%2****************@TK2MSFTNGP09.phx.gbl...
: > 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
Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by lofty | last post: by
reply views Thread by Zlatko Matić | last post: by
2 posts views Thread by Abdul N K | last post: by
3 posts views Thread by Annette Massie | last post: by
4 posts views Thread by ey.markov | last post: by
1 post views Thread by C.Davidson | last post: by
2 posts views Thread by Rich Raffenetti | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.