Link to home
Start Free TrialLog in
Avatar of LuckyLucks
LuckyLucks

asked on

Datatype conversion in SSIS

Hi,

   I am trying to convert a salary field (coming from a comma delimited txt file) into an int so that I can compare it to 20000 in a SSIS conditional split condition.
What I do in the conditional split is this:
Cast([Salary] as int) > cast(20000 as int)

However, I keep getting this error in the attatchment. How can i convert my text field Salary to an int and then compare to 20K?

thx
ASKER CERTIFIED SOLUTION
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Error in attachement?

You must see that all input-record have valid input.  The IsNumeric()-function can be usefull to filter the invallid records out first. What to do with the others depends on your process: neglect with or without (I hope not) error, putting dummy 0 in the place ...
Try
Cast(replace([Salary],',','') as int) > cast(20000 as int)

Open in new window