Page 1 of 1

stringtoTimestamp Conversion

Posted: Wed Nov 04, 2009 10:23 pm
by mekrreddy
Hello,

I have to compare an incoming datefield with another date field, but my date_field1 have some null values in some records, i am trying to substitute 01/01/2001 12:00:12 in place of null to avoid the comparision fail (failed comparing date and null)

my code is like this This is in Tx Constraint.

NullToValue(Date_field1, StringToTimestamp(''01/01/2001'', [%"%yyyy-%mm-%dd %hh:%nn:%ss"%])) > Date field2

but throwing the syntax error, can you guys please help me out!!

Thanks in advance.

Posted: Wed Nov 04, 2009 10:29 pm
by ray.wurlod
Why do you have % characters surrounding the format string?

Tip: When the Transformer stage expression editor throws a syntax error, right click on the expression and choose Validate Expression; the editor will report what it believes to be the actual syntax error.

Posted: Fri Nov 06, 2009 8:59 am
by mekrreddy
I dont see validate expression when i right click, can anyone give me the syntax for this please!!!

Posted: Fri Nov 06, 2009 2:04 pm
by ray.wurlod
You have to do it without the expression editor open. To put it another way, right click on the red expression, not on the opened expression.