1

I am trying to check data on the products table which has a column of discontinued item i.e. 1 is true and 0 is false. I am using a derived column to output the result in the staging table to YES for 1 or NO for 0. However, when it comes to linking the discontinued column in the lookup it throws an error of data type of mismatch! Discontinued data type in the source table and the staging table is the same i.e. BIT.

This is the expression I used in the derived column:

(Discontinued == (DT_BOOL)"False" ? "NO" : "YES")   

This is the error when joining the derived column DiscontinuedCheck to Discontinued

enter image description here

Dodi
  • 111
  • 4
  • 14
  • 1
    Shouldn't you map Discontinued to Discontinued instead of DiscontinuedCheck? Mapping "Yes" to TRUE seems odd to me... – Tyron78 Jan 17 '17 at 10:51
  • I don't know which column is which but the data type of your derived column is not `BIT` so if your'e joining that to `BIT`, that's the problem – Nick.Mc Jan 17 '17 at 10:59
  • Hi Tyron78, I have done the name as the above just to try it first and then once it works I will verify this – Dodi Jan 17 '17 at 11:02
  • Hi Nick, Yes, I believe this is the problem! Initially converting to bool then try to link it to BIT ! Just to add the highlighted one in the left DiscontinuedCheck(derived column) should be linked to the once at the right Discontinued (Destination) – Dodi Jan 17 '17 at 11:04
  • But this is what I said: "TRUE" or "NO" or whatever is not boolean. You should be fine simply mapping the two Discontinued columns without a derived column. mapping 0 or 1 to a bit column should work fine. – Tyron78 Jan 17 '17 at 11:49
  • Thank you Tyron, it does make sense now. I thought that I could convert the 1s and 0s to yes & no using the derived column !! – Dodi Jan 17 '17 at 12:17
  • You are welcome. :-) Accepting the answer would be nice of you. – Tyron78 Jan 17 '17 at 13:50

1 Answers1

1

"TRUE" or "NO" or whatever is not boolean. You should be fine simply mapping the two Discontinued columns without a derived column. mapping 0 or 1 to a bit column should work fine.

Tyron78
  • 4,117
  • 2
  • 17
  • 32