Tuesday, February 21, 2017

is date function in Netezza

Check for valid date/time-stamp
There is so such built-in function , but you can user regexp to validate the value. Below the code. It will return true if it is valid time-stamp else false.

Select SQLEXT.regexp_like(current_timestamp ,'\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$'



CASE  WHEN  REGEXP_LIKE(COl1,'[0-9]' )  THEN  'NUMBER ONLY' ELSE COl1  END  as COl1

No comments:

Post a Comment