473,383 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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 10053
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: lofty | last post by:
Dear Lord, I'm trying to code a drop down for a date entry that gives the user the option of the current date plus the dates of the last 7 days. <% for i = -7 to -1 Response.write...
9
by: Brandon | last post by:
Greetings, I am having a problem getting a SQL statement that is functional in Access 2K to work in ASP. My Access SQL statement is this: SELECT DateAdd('s',Ticket_Opened_Date,'Dec 31, 1969...
0
by: Zlatko Matiæ | last post by:
I am currently migrating from MSDE to PostgreSQL and have to rewrite the function that is calculating next date of sampling... In MSDE there is a DateAdd function. I can't find the appropriate...
1
by: Raghu | last post by:
Hello... I am running into a problem while running a query..can some1 help.. this is the query : ************** SELECT * from Table S where S.dtDate1 BETWEEN...
2
by: Abdul N K | last post by:
I need help in T-SQL. I am using DATEADD function and I want to add 6 months to a date. But it does not return me the rusults, which I want e.g. SELECT DATEADD(m,'20040630') returns 20041230...
3
by: Annette Massie | last post by:
I am trying to insert a record into a table via code and one of the values to add I would like as a dateadd calculation on a value from a query. My code looks like this: Set db = CurrentDb() ...
4
by: ey.markov | last post by:
Greetings, I have an A2K application where for a report the user enters a month-end date, and the system must gather transactions for that month. No problem, I thought, I'll just use the DateAdd...
1
by: C.Davidson | last post by:
Does subject VB.net 2003 support DateAdd function? I have tried to implement the following without success. In my example I tried to simply add 30 months to 9/18/2003 and I get "New date: 12:00:00...
2
by: Rich Raffenetti | last post by:
I have the following code. If I do the dateadd function with dateinterval.minute, it works fine and the date/time value is displayed with zero seconds. If I do the dateadd function with...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.