vamsi.4a6 wrote:1)Define a stage variable
If Isvalid ("date", Datecol,"%yyyy%mm%dd") then 1 else 0-sv
2)Use constraint sv=0
A couple of learning points:
There really isn't any difference between the two posted approaches (other than one checks for true and the other false), so unless we know the why of the "not working" comment I doubt it will help. Also, there's no need for the
if-then-else wrapper for the derivation, especially one that sets the output to 1 or 0. As shown in the original post, they will always derive "true" or "false" automagically, which also just so happens to be 1 (technically non-zero) and 0 under the covers.
So, having said that... vskr72, can you post
actual examples of your incoming records? Can you also confirm the data type you are using for these 'date' fields? You also said you only showed us one column, can we assume you need to check multiple date fields and reject the record if
any of them are invalid? If so, I'd be curious what your
full constraint looks like.