Home » Other » Community Hangout » My birthdate using sysdate - entire life :)
My birthdate using sysdate - entire life :) [message #285955] Thu, 06 December 2007 03:20 Go to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

I hope ,

 select  add_months(TRUNC(sysdate,'CC'),-248)+4 from dual  


will give me My birthdate during my future lifetime Smile

Thumbs Up
rajuvan

[Updated on: Thu, 06 December 2007 03:25]

Report message to a moderator

Re: My birthdate using sysdate - entire life :) [message #285956 is a reply to message #285955] Thu, 06 December 2007 03:21 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Very interesting.

Regards
Michel
Re: My birthdate using sysdate - entire life :) [message #286096 is a reply to message #285955] Thu, 06 December 2007 08:08 Go to previous messageGo to next message
joy_division
Messages: 4643
Registered: February 2005
Location: East Coast USA
Senior Member
rajavu1 wrote on Thu, 06 December 2007 04:20

I hope ,

 select  add_months(TRUNC(sysdate,'CC'),-248)+4 from dual  


will give me My birthdate during my future lifetime Smile

Thumbs Up
rajuvan


FOO SCOTT>l
  1* select  add_months(TRUNC(sysdate,'CC'),-248)+4 from dual
FOO SCOTT>/

ADD_MONTHS
----------
05/05/1980


eh?
Re: My birthdate using sysdate - entire life :) [message #286100 is a reply to message #286096] Thu, 06 December 2007 08:17 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
./fa/3529/0/

Regards
Michel
  • Attachment: r3.JPG
    (Size: 4.31KB, Downloaded 477 times)
Re: My birthdate using sysdate - entire life :) [message #286105 is a reply to message #286096] Thu, 06 December 2007 08:23 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
joy_division wrote on Thu, 06 December 2007 15:08



eh?

I guess the original post was a new entry in the 'I-have-too-much-time-on-my-hands,-what-nonsense-query-can-I-write-hey-look-it-compiles-lets-dump-it-at-orafaq' category.
Face it boys, those things are best left to nerds. We are not nerds; nerds don't do Oracle. In fact they loathe Oracle about as much as they do Microsoft.



(sorry Michel, more than 80 characters wide)
Re: My birthdate using sysdate - entire life :) [message #286116 is a reply to message #286105] Thu, 06 December 2007 08:47 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:

sorry Michel, more than 80 characters wide

Don't worry, 80 characters is only for code otherwise lines are fold.

Regards
Michel
Re: My birthdate using sysdate - entire life :) [message #286222 is a reply to message #286105] Thu, 06 December 2007 23:18 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

Hmhmhm .. .

You means to say I am a 'non-sence-query-dumper' in Orafaq ? Sad


select  add_months(TRUNC(sysdate,'CC'),-248)+4 from dual  


will give the same date till 33992 more days from now (almost 93 years )

Who want to go alive 97 more Years ? Confused

Thumbs Up
Rajuvan
icon13.gif  Re: My birthdate using sysdate - entire life :) [message #286318 is a reply to message #286222] Fri, 07 December 2007 02:55 Go to previous messageGo to next message
pablolee
Messages: 2835
Registered: May 2007
Location: Scotland
Senior Member
Yeah, but what exactly is the point? I just don't get where the posted code is worthy of special note. It is a pretty simple calculation. Would you post a query having just discovered the use of the MOD function? (Actually scratch that, you might well do, based on current experience of you)
Re: My birthdate using sysdate - entire life :) [message #286322 is a reply to message #285955] Fri, 07 December 2007 03:06 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

Hm..

I could have done that .
But Michel would not allow me to do that (atleast today) Smile

Thumbs Up
Rajuvan

[Updated on: Fri, 07 December 2007 03:07]

Report message to a moderator

Re: My birthdate using sysdate - entire life :) [message #286331 is a reply to message #286322] Fri, 07 December 2007 03:18 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I allow or forbid nothing but anyway you will have to endure my comments.

Regards
Michel

[Updated on: Fri, 07 December 2007 06:12]

Report message to a moderator

Re: My birthdate using sysdate - entire life :) [message #286340 is a reply to message #286322] Fri, 07 December 2007 03:24 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
In fact, since your 'trunc(sysdate,'CC')' will return the same date for, like you said, the next 92 years or so it doesn't make much sense. You use a fixed date (well, not really but you know what I'm hinting at) and perform fixed calculations on that. You could as well have used:
SQL> select add_months(to_date('01010001','ddmmyyyy'), 23752)+4 x
  2  from dual;

X
----------
05/05/1980
And when all factors are fixed, why not use the fixed result itself?

MHE
Re: My birthdate using sysdate - entire life :) [message #286346 is a reply to message #286340] Fri, 07 December 2007 03:31 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Silly developer hand job.

Regards
Michel

[Updated on: Fri, 07 December 2007 03:32]

Report message to a moderator

Re: My birthdate using sysdate - entire life :) [message #286354 is a reply to message #285955] Fri, 07 December 2007 03:40 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member



Quote:


Very interesting.

Regards
Michel


Quote:


Silly developer hand job.

Regards
Michel



Cool
Rajuvan.
Re: My birthdate using sysdate - entire life :) [message #286355 is a reply to message #285955] Fri, 07 December 2007 03:45 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

Maher,

You are right .

I interesting point was to make other curious at very very first impression by using sysdate in the query. Nothing so important from that. Smile

Thumbs Up
Rajuvan

Re: My birthdate using sysdate - entire life :) [message #286360 is a reply to message #286354] Fri, 07 December 2007 03:51 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You likely misread my first post, it was written with the sarcastic font maybe it is not displayed on your screen.

Regards
Michel
Re: My birthdate using sysdate - entire life :) [message #286365 is a reply to message #285955] Fri, 07 December 2007 03:56 Go to previous messageGo to next message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

Sorry for Misunderstanding you for a while

Sad
Rajuvan
Re: My birthdate using sysdate - entire life :) [message #286386 is a reply to message #286365] Fri, 07 December 2007 04:23 Go to previous message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Since this topic won't go anywhere but a flame-war, I will lock it.
Fair warning to all: I will take the liberty to remove any additional posts. (or at least report to Frank N)
Previous Topic: A, B and C in Numeric Spelling
Next Topic: Top 10 Largest databses in the World
Goto Forum:
  


Current Time: Thu Dec 08 14:30:19 CST 2016

Total time taken to generate the page: 0.30369 seconds