Hi @Jinal Contractor
BIT is an integer data type that can take a value of 1, 0, or NULL.
Only the string values TRUE and FALSE can be converted to bit values: TRUE is converted to 1 and FALSE is converted to 0.
SQL server cannot convert string values like 'Yes/No' or 'On/Off' to bit values.
Therefore, you need to check what string values do you have in PERUNIT, VARBOM and FORCECH columns.
For example, assuming your PERUNIT column contains Yes/No values, then you can use a Case When statement to solve it, like this:
SELECT ASSM, ITEM, LEFT(ITMDESC,35), SEQNO, BEGDATE, ENDDATE, QTY, SCRAP, COST
,PERUNIT = CASE PERUNIT WHEN 'Yes' THEN '1' Else '0' END
,UNMSID, CNVF, REVL, VARBOM, [FORCECH], SHRINKAGE, SPECIAL
FROM [BOM Data$] WHERE ITEM is not null
Best regards,
LiHong
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.