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: users+help@global.libreoffice.org
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
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.