A four digit number. query in SQL/PLSQL e.g.'18-nov-2002' = 2322 (year&322th-day of the year)

trivedisushil
trivedisushil used Ask the Experts™
on
eg.
The first digit is derived from the year i.e in the year 2002, the digit would be 2,
for 2003 it will be 3.

The remaining three digits are then derived from the number of the day in the year
i.e. for January 31 it will be 2031.

i.e.today 18th Nov.2002,
which is 322nd day of the year so will be 2322
similarly which will become 2323 tomorrow.

Hope above is clear.

Can u Suggest the query for the same in SQL/PLSQL
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2004
Commented:
hi,

SELECT TO_CHAR(SYSDATE,'YDDD') FROM DUAL;

you can replace SYSDATE with your DateField
and DUAL with your table

meikl ;-)

Author

Commented:
Can anybody tell me about the Books Prefered for OCP in India and Edu.centre in Mumbai for the same.
trivedisushil:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial