I have a date column coming from source table. Challenge is to validate the date whether it is in right format.
Example Values of source column:
22-AUG-2010 --> Valid date/format as per business rule
22 AUG 2010 --> InValid date/format as per business rule
22/AUG/201 ---> Invalid date/format as per business rule
I have used is_date function in expression as below :i
Surprisingly all the above three example values have returned output as 1 saying all are valid dates even though i have specified format as 'DD-MON-YYYY'.ats
Could anyone please help me to restrict invalid date formats.
Appreciate your help in advance.
I found answer for your questions kamalakar.
whtever you doing right now is correct procedure to validate the date function.
Before that,tell me the file which is having this date format should be string and the port which you storing after the date validation should be date.
eg : validate_date string ;
I hope this will help you definitely.revet me back if u need any help.
Thanks for your response. The code which was provided by you says all below date formats are valid.
22 AUG 2010
But i just want "22-AUG-2010" as a valid format and rest as invalid. Is their a way to restrict them using is_date or any other functions?
Try this and let me know if this works?
Hope this logic works.
Is that above logic working fine ?! let me know if you need any further information .?
thanks for your reply. this logic works.
Good hear that your issue is resolved. Hey,still this issue status is showing NOT ANSWERED could please give your status to this issue so that ppl can check for future reference.
Feel free to post your question's.