Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Birthday Query

Re: Birthday Query

From: Brian Tkatch <SPAMBLOCK.Maxwell_Smart_at_ThePentagon.com.SPAMBLOCK>
Date: Tue, 23 Oct 2001 01:34:29 GMT
Message-ID: <3bd4c71d.985890281@news.alt.net>


On Mon, 22 Oct 2001 22:30:22 GMT, "Scott Mattes" <ScottMattes_at_yahoo.com> wrote:

>Have you tried a solution where you take and format the birthday to_char as
>DDD and then to_date from DDD? It will handle leap years, except for 12/31.
>And if you always subtract/add 1 from/to birthday and sysdate that should
>take care of that one also.

I tried that, but then dropped it because of 12/31 problem. How can I add or drop a day? Do you mean with a DECODE operation checking when the day is 31? If you mean 2/28, then it dies anyway when adding/subtracting on 2/28 or 3/1 in a leap year, and I'll have the same poblem. If you mean to DDD then I'll have a problem when I hit 0 or 366/7 Of course I could MOD it based on the amount of days in this year, but that seems a bit tedious, and would be off by two days when 367 is modded.

I'd rather not be off a day, unless I have to, as with 2/29, in which it is my choice to make it 2/28 or 3/1. And I let the function I use choose that. :-)

I appreciate the reply. Please, let me know what you think.

Brian Received on Mon Oct 22 2001 - 20:34:29 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US