如何将文本的数据类型转换为“是/否”的数据类型 [英] How to convert a datatype of text to a datatype of 'yes/no'

查看:140
本文介绍了如何将文本的数据类型转换为“是/否”的数据类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在导入一个包含文本列的文件,其值为null或Y。我将它们插入到一个表中,该表将列定义为是/否数据类型。所以在我的逻辑中,我需要转换Y的所有值。是真实的''。

我试图通过在插入语句中使用以下条件语句来实现这一点:

IIf(UCase(rsTemp!new_asset_flag),Y ;,0)我也试过,IIf(UCase(rsTemp!new_asset_flag),Y,真)


这些都不会有效,我得到了表示数据类型不匹配的错误。任何建议将不胜感激!!

谢谢

解决方案

尝试

展开 | 选择 | Wrap | 行号


我建​​议:

展开 | 选择 | Wrap | 行号

你说''土豆''我说''pawtato''


欢呼,


I am importing a file that has a text column and the value is either null or ''Y''. I am inserting them into a table that has the column defined as a ''Yes/No'' datatype. So in my logic I need to convert all values of "Y" to be ''True''.
I am trying to accomplish this by using the following conditional statements as part of my insert statement:

IIf(UCase(rsTemp!new_asset_flag), "Y", 0) and I also tried, IIf(UCase(rsTemp!new_asset_flag), "Y", True)

Neither one of these will work, I get an error stating "datatype mismatch". Any suggestions would be appreciated!!
Thanks

解决方案

Try

Expand|Select|Wrap|Line Numbers


I would suggest :

Expand|Select|Wrap|Line Numbers


You say ''potato'' I say ''pawtato''

cheers,


这篇关于如何将文本的数据类型转换为“是/否”的数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆