日期:2014-05-18  浏览次数:20750 次

在应使用条件的上下文(在 'charindex' 附近)中指定了非布尔类型的表达式 哪错了
select F_Name from t_dict where F_Name charindex(','+F_name+',',  
',F_Status,F_BillID,F_Date,F_SupplierID,F_StockTime,F_AccountDate,F_SupplierName,F_Storage,')>0  

消息 4145,级别 15,状态 1,第 1 行
在应使用条件的上下文(在 'charindex' 附近)中指定了非布尔类型的表达式


怎么回事


------解决方案--------------------
SQL code

select F_Name from t_dict where charindex(','+F_name+',',   
',F_Status,F_BillID,F_Date,F_SupplierID,F_StockTime,F_AccountDate,F_SupplierName,F_Storage,')>0

------解决方案--------------------
你的F_Status,F_BillID,F_Date,F_SupplierID,F_StockTime,F_AccountDate等等是字段名字吗?
如果是且都是varchar类型的那可以
SQL code

select F_Name from t_dict where charindex(','+F_name+',',',' +  F_Status + ',' +  F_BillID + ',' +F_Date + ',' +F_SupplierID + ',' +F_StockTime + ',' +F_AccountDate + ',' + F_SupplierName + ',' + F_Storage + ',')>0