Date addition in a constraint

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
Benny Domeij
Participant
Posts: 6
Joined: Mon Mar 07, 2005 2:43 am

Date addition in a constraint

Post by Benny Domeij »

I'm trying to have a constraint that does the following:

StringToDecimal(StageVar) <= StringToDecimal(StageVar1) +1

The two stage variables have these codes:

StageVar1 DateToString(DSLink247.valid_to_date)
StageVar DateToString(DSLink247.renewal_date)

I have also made two columns to check the values in StageVar1 and StageVar:
renewal_date2 Integer 8 StringToDecimal(StageVar)
valid_to_date2 Integer 8 StringToDecimal(StageVar1) +1

But I just get 1 and 0 in the columns, why and how do I solve this?
Benny Domeij
Participant
Posts: 6
Joined: Mon Mar 07, 2005 2:43 am

Post by Benny Domeij »

The format of renewal_date and valid_to_date are "2008-08-01"...
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

StringToDecimal('2008-01-01') does not result in that which you are looking for. Try JulianDayFromDate to get an integer.
Post Reply