Hi,
Please advice on following situation.
I have a value coming from the source which normally should look like this '20080701' or '20071105' but sometimes they delivered this '20080000'. I want to build a check in the stage variables to exclude these incorrect values. Please advice me how to check only on the last 4 digits? reject when the last 4 digits is 0000.
Thanks in advance
compare of 2 values
Moderators: chulett, rschirm, roy
Put a constraint of "RIGHT(In.DateColumn,4)<>'000'"
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 42
- Joined: Wed Dec 26, 2007 1:58 am
- Location: India
Re: compare of 2 values
The values was seems to be a date value,first u have to take the last 2 digits by using Right(column_name,2) function & chk whether it is less than 31 & then take the last 4 digits by using Left(Right(column_name,4),2) & chk whether it is less than 12.Tlam wrote:Hi,
Please advice on following situation.
I have a value coming from the source which normally should look like this '20080701' or '20071105' but sometimes they delivered this '20080000'. I want to build a check in the stage variables to exclude these incorrect values. Please advice me how to check only on the last 4 digits? reject when the last 4 digits is 0000.
Thanks in advance
Check for both these conditions,if both are not satisfied then reject the records by placing it in a constraint.
Regards
-
- Participant
- Posts: 46
- Joined: Tue Aug 21, 2007 5:39 am
- Location: Bangalore, India
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If you want to search for "valid date" it's a slightly different approach. Use something like
Code: Select all
Oconv(Iconv(InLink.TheDate,"DYMD"),"DYMD[4,2,2]":@VM:"MCN") <> InLink.TheDate
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.