Hi,
Users can enter dates in a text field in either 2yr or 4 year format. Would like to check the value of these in a trigger for a valid date range but what is the best way to do so ? For example,
DECLARE l_test DATE;
BEGIN
IF :NEWDATA.USER_1 > ' ' Then
l_test := TO_DATENEWDATA.USER_1, 'MM/DD/YYYY');
END IF;
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-220000, 'Contract Date is not a Valid Date');
END;
This works great for a four year date format but skips the 2year format. Just a length check ?
Thanks, Steve.
Users can enter dates in a text field in either 2yr or 4 year format. Would like to check the value of these in a trigger for a valid date range but what is the best way to do so ? For example,
DECLARE l_test DATE;
BEGIN
IF :NEWDATA.USER_1 > ' ' Then
l_test := TO_DATENEWDATA.USER_1, 'MM/DD/YYYY');
END IF;
EXCEPTION
WHEN OTHERS THEN
raise_application_error(-220000, 'Contract Date is not a Valid Date');
END;
This works great for a four year date format but skips the 2year format. Just a length check ?
Thanks, Steve.