stringtoTimestamp Conversion

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
mekrreddy
Participant
Posts: 88
Joined: Wed Oct 08, 2008 11:12 am

stringtoTimestamp Conversion

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mekrreddy
Participant
Posts: 88
Joined: Wed Oct 08, 2008 11:12 am

Post by mekrreddy »

I dont see validate expression when i right click, can anyone give me the syntax for this please!!!
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply