Connecting Tech Pros Worldwide Help | Site Map

Month problem

  #1  
Old November 13th, 2005, 08:51 AM
John
Guest
 
Posts: n/a
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, 08:52 AM
Allen Browne
Guest
 
Posts: n/a

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, 08:52 AM
Devonish
Guest
 
Posts: n/a

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, 08:55 AM
John
Guest
 
Posts: n/a

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, 08:55 AM
Jeff Smith
Guest
 
Posts: n/a

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]


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
linq group by month problem Seb answers 5 July 18th, 2008 10:05 AM
DateDiff - Whole Month Problem J-P-W answers 4 July 17th, 2006 10:55 PM
Format command and order by month problem... Ataru Morooka answers 5 November 13th, 2005 04:08 AM
Month problem??? Job Lot answers 2 July 21st, 2005 08:50 PM