• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
I tried this, and it worked, thanks! Had a brain fart, I guess...

Thanks for your help!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic