473,395 Members | 1,583 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,395 software developers and data experts.

Month problem

Hi,
I am using a text box to input a date in a form and from that date I
want to show a new date in another text box which is one calendar week
later. As it is, it works fine untill I reach the end of the month, but the
month is not incrementing forward automatically. How do I fix this?

=(DateSerial(Year([PaymentDate]),Month([PaymentDate]),Day([PaymentDate]+7)))

Tia John
Nov 13 '05 #1
4 1381
Try:
=DateAdd("d", 7, [PaymentDate])
or even:
=[PaymentDate] + 7

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"John" <lk*******@jhk.net> wrote in message
news:on*******************@news.indigo.ie...
Hi,
I am using a text box to input a date in a form and from that date I
want to show a new date in another text box which is one calendar week
later. As it is, it works fine untill I reach the end of the month, but
the
month is not incrementing forward automatically. How do I fix this?

=(DateSerial(Year([PaymentDate]),Month([PaymentDate]),Day([PaymentDate]+7)))

Tia John

Nov 13 '05 #2

Try

DateAdd("w",7,[PaymentDate])
Ron Devenish

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #3
Hi Folks,
this worked great for me, now can I replace the "w", with
"m" for month, and "y" for year and get similar results: eg. will
DateAdd("m",3,[PaymentDate]) give me a quarterly increment.
TIA, John
"Devonish" <no*****@nowhere.com> wrote in message
news:42**********@127.0.0.1...

Try

DateAdd("w",7,[PaymentDate])
Ron Devenish

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 13 '05 #4
Year should be "yyyy". "y" gives you the day of the year. Go to the VBA help
file and search for the DateAdd function. Here it will show you all the
settings for each argument.

Jeff
"John" <lk*******@jhk.net> wrote in message
news:eY*******************@news.indigo.ie...
Hi Folks,
this worked great for me, now can I replace the "w", with
"m" for month, and "y" for year and get similar results: eg. will
DateAdd("m",3,[PaymentDate]) give me a quarterly increment.
TIA, John
"Devonish" <no*****@nowhere.com> wrote in message
news:42**********@127.0.0.1...

Try

DateAdd("w",7,[PaymentDate])
Ron Devenish

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Hasanain F. Esmail | last post by:
Hi all, I sincerly thank you all in advance for your help to solve this problem. I have been trying to find a solution to this problem for sometime now but have failed. I am working on a...
34
by: prosoft | last post by:
When I use Dim myDTFI As DateTimeFormatInfo = New CultureInfo("he-IL", True).DateTimeFormat Dim strhmon1 As String = (myDTFI.GetMonthName(hmon1)) MsgBox(strhmon1) I get the local name of the...
10
by: Jim | last post by:
I'm sure this has been asked before but I can't find any postings. I have a table that has weekly inspections for multiple buildings. What I need to do is break these down by the week of the...
22
by: Stan | last post by:
I am working with Access 2003 on a computer running XP. I am new at using Access. I have a Db with a date field stored as mm/dd/yyyy. I need a Query that will prompt for the month, ie. 6 for...
5
by: Seb | last post by:
I want to count activity in a given month. I'm trying to do so with the linq code below however it reports: Error 1 'a' is inaccessible due to its protection level var ActivityByMonths = from a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.