dateadd()

Discussion in 'ASP General' started by Øyvind Isaksen, Oct 17, 2003.

  1. 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
    Øyvind Isaksen, Oct 17, 2003
    #1
    1. Advertising

  2. Øyvind Isaksen

    Ray at Guest

    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" <> wrote in message
    news:%...
    > 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
    >
    >
    Ray at, Oct 17, 2003
    #2
    1. Advertising

  3. Øyvind Isaksen

    Tom B Guest

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

    "Øyvind Isaksen" <> wrote in message
    news:%...
    > 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
    >
    >
    Tom B, Oct 17, 2003
    #3
  4. Øyvind Isaksen

    Evertjan. Guest

    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)
    Evertjan., Oct 17, 2003
    #4
  5. Øyvind Isaksen

    Ken Schaefer Guest

    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:...
    : 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" <> wrote in message
    : news:%...
    : > 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
    Ken Schaefer, Oct 18, 2003
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt Tapia

    DateAdd Function and error BC30451

    Matt Tapia, Aug 13, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    2,159
    Chris R. Timmons
    Aug 13, 2003
  2. Mel

    DateAdd Function

    Mel, Nov 4, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    6,004
  3. lofty

    DateAdd does not work

    lofty, Jul 20, 2003, in forum: ASP General
    Replies:
    5
    Views:
    163
    Chris Barber
    Jul 20, 2003
  4. Tipple
    Replies:
    2
    Views:
    118
    Tipple
    Oct 16, 2003
  5. Gabe

    Dateadd function not adding up...

    Gabe, Oct 30, 2003, in forum: ASP General
    Replies:
    3
    Views:
    138
    Ray at
    Oct 31, 2003
Loading...

Share This Page