Connecting Tech Pros Worldwide Help | Site Map

Month problem

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 13th, 2005, 07:51 AM
John
Guest
 
Posts: n/a
Default 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



  #2  
Old November 13th, 2005, 07:52 AM
Allen Browne
Guest
 
Posts: n/a
Default Re: Month problem

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" <lkjlkjlkj@jhk.net> wrote in message
news:onDVd.48741$Z14.36281@news.indigo.ie...[color=blue]
> 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[/color]


  #3  
Old November 13th, 2005, 07:52 AM
Devonish
Guest
 
Posts: n/a
Default Re: Month problem


Try

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


Ron Devenish

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4  
Old November 13th, 2005, 07:55 AM
John
Guest
 
Posts: n/a
Default Re: Month problem

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.spam@nowhere.com> wrote in message
news:42274e48$1_1@127.0.0.1...[color=blue]
>
> Try
>
> DateAdd("w",7,[PaymentDate])
>
>
> Ron Devenish
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it![/color]


  #5  
Old November 13th, 2005, 07:55 AM
Jeff Smith
Guest
 
Posts: n/a
Default Re: Month problem

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" <lkjlkjlkj@jhk.net> wrote in message
news:eY7Wd.48847$Z14.36898@news.indigo.ie...[color=blue]
> 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.spam@nowhere.com> wrote in message
> news:42274e48$1_1@127.0.0.1...[color=green]
> >
> > Try
> >
> > DateAdd("w",7,[PaymentDate])
> >
> >
> > Ron Devenish
> >
> > *** Sent via Developersdex http://www.developersdex.com ***
> > Don't just participate in USENET...get rewarded for it![/color]
>
>[/color]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.