On 01/28/2012 05:42 AM, Mark Stanton wrote:
I think (without actually having tried it) that just adding numbers
to a date field will do what you want, so<your date field>+365
should give you the "year in advance" date
A side note of caution. Not every year has 365 days, so tricks are usually used to do things such as add one month or add one year. I expect there to be date arithmetic functions available to do this in SQL, but, if they are not easily obtained, you use tricks to manually extract things such as the day / month / year, add the portions of interest, and convert back. You can still get in trouble when moving from a leap year to a non-leap year if you try to simply add one year and keep all other things the same (because the number of days in one of the months may change). That said, for quick and dirty calculations, I do things very similar to what you recommend.

--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
Info:  http://www.pitonyak.org/oo.php


--
For unsubscribe instructions e-mail to: [email protected]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to