Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to ignore year from date

1054973Nov 22 2013 — edited Nov 22 2013

DECLARE

V_HD EMP.HIREDATE%TYPE;

V_FM VARCHAR2(30);

V_STAR VARCHAR2(30);

BEGIN

V_FM :='&FORMAT_MASK';

V_HD:=TO_DATE('&HIREDATE',V_FM);

DBMS_OUTPUT.PUT_LINE(V_HD||CHR(10)||TO_CHAR(V_HD,V_FM));

V_STAR:= CASE WHEN V_HD BETWEEN TO_CHAR('01-01-%%%%', 'dd-mm') AND TO_CHAR('01-02-%%%%', 'dd-mm')

THEN 'YOUR STAR is capricorn'

ELSE 'any other star'

END;

DBMS_OUTPUT.PUT_LINE(V_STAR);

END



I want to avoid year from date , & get the month & day , so there star will define,,

how to ignore year ?I have to extract month & day at a time, as there are many cases for all stars in a year,

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 20 2013
Added on Nov 22 2013
2 comments
525 views