IsValidDate function not returning 1 or 0
Posted: Wed Feb 15, 2012 6:49 am
Hi All,
I have an input column of Varchar datatype which can have two formats:
ddmmyyyy or yyyymmdd. So to be able to process both types of records, I use the function
But while trying to implement the above (for a sample input 04102010), the records get dropped. Upon investigation, I have concluded that this is happening since the function IsValidDate(StringToDate(StageVar, "%yyyy%mm%dd")) is returning NULL (instead of an expected 0), and the record's getting dropped. Also, I get the following warning:
thanks
sriram
I have an input column of Varchar datatype which can have two formats:
ddmmyyyy or yyyymmdd. So to be able to process both types of records, I use the function
Code: Select all
If IsValidDate(StringToDate(StageVar, "%yyyy%mm%dd")) Then StringToDate(StageVar, "%yyyy%mm%dd")
Else
StringToDate(StageVar, "%dd%mm%yyyy")
Can anyone please guide me on thisConversion error calling conversion routine date_from_string data may have been lost
thanks
sriram