• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with carrying over the correct months while using GetDate()

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Situation:

I have an original date field, a 2nd payment, and 3rd payment options. I also have a followup field. (all text fields).
The 2nd payment adds a month. The 3rd payment adds 2 months to the original date field. The followup field add 3 days from the original date field.
Example:
Original Date: 02/03/2010
1st payment: 03/03/2010
2nd payment: 04/03/2010
Followup field: 02/05/2010.

Problem:
So far, all this code is working. The part that gets tricky is if the original date is a date at the end of the month like: 02/28/2010. The followup field is saying 02/31/2010.
Here is the code I have currently:


 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well why don't you rely on the Date Object to add the days for you



Eric
 
Heather Rose
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried this, and it worked, thanks! Had a brain fart, I guess...

Thanks for your help!
reply
    Bookmark Topic Watch Topic
  • New Topic