I'm looking for a way to advance the current date and keep the day of week, or advance the month and keep the same day or Advance the year and keep the same month and day.
For example: 08/14/06 Advance ONE WEEK would be on a Monday 08/21/06 or 08/18/06 Advance ONE MONTH would be 09/18/06 or Advance ONE YEAR would be 09/18/07.
I found where I can advance the DAYS and I guess advance 7 days for a week would work, but not for MONTH or YEAR?
Any suggestions?
Advance Date function
-
- Posts: 595
- Joined: Sun Apr 24, 2005 2:22 am
- Contact:
To advance one week:
MyObject.MyDate + 7
To advance one year:
DATE(DAY_OF_MONTH(MyObject.MyDate), MONTH(MyObject.MyDate), YEAR(MyObject.MyDate) + 1)
You can also use function DATE for advancing months by incrementing the month parameter. Functions like LAST_DAY_OF_MONTH, LAST_DAY_OF_NEXT_MONTH, and others may be useful if you need to take special care when advancing end-of-month dates, like the 31st.
MyObject.MyDate + 7
To advance one year:
DATE(DAY_OF_MONTH(MyObject.MyDate), MONTH(MyObject.MyDate), YEAR(MyObject.MyDate) + 1)
You can also use function DATE for advancing months by incrementing the month parameter. Functions like LAST_DAY_OF_MONTH, LAST_DAY_OF_NEXT_MONTH, and others may be useful if you need to take special care when advancing end-of-month dates, like the 31st.
Aware IM Support Team