Check if date is greater than 2000 in PL/SQL

How to check if the date is greater than the year 2000 in PL/SQL?

How to check if the date is greater than the year 2000 in PL/SQL?
You have two options here. One option is to convert the date value to a string and do a string comparison as follows:
IF (TO_CHAR(date_val,'YYYY') > '2000') THEN
   
  
   
END IF;

  
Another option is to use the TO_DATE function to convert the comparison string to a date value.
IF (date_val > TO_DATE('12/31/2000','MM/DD/YYYY')) THEN 
   
  
   
END IF;

  

Dig Deeper on Oracle database administration

Data Management
Business Analytics
SearchSAP
TheServerSide.com
Data Center
Content Management
HRSoftware
Close