我想念的是什么? [英] What I'm I missing?

查看:132
本文介绍了我想念的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我创建了一个网站,并使用SQL 2000/SQL2005作为后端,我的任务是获取我为该网站建立的目录,并允许它在CD上运行.因此,使用网站的CD版本,我正在使用Access 2003数据库,但是由于某种原因,我的T-SQL查询无法与Access一起使用.我的SQL数据库中有一个字段用作活动标志. Access为此使用是/否"字段,但我不确定为什么查询不起作用.我确实注意到Access使用的是-1/0,而不是1/0,所以我更改了查询以反映以下内容:

Hi all,
I''ve created a website the is using SQL 2000/SQL2005 as the back end and I''ve been tasked to take the catalog I''ve build for the website and allow it to be ran on a CD. So With the CD version of the website I''m using a Access 2003 database, but for some reason my T-SQL queries wont work with Access. I have a bit field in my SQL database that I use as an Active flag. Access use a "Yes/No" field for this and I''m not sure why the query isn''t working. I did notice that Access uses -1/0 and not 1/0, so I changed my query to reflect this:

<br />SELECT     * <br />FROM tblWeb_E_Catalog_Categories <br />WHERE (Active) = -1) <br />




有没有任何理由为什么这样做? 没用吗?




Is there any reason why this wouldn''t work?

推荐答案

我看到两个右括号))和仅一个开放括号. (
I see two closing parenthesis )) and only 1 open parenthesis. (




... WHERE NOT (Active = 0)可能对两个数据库系统都适用.

:)

Hi,

... WHERE NOT (Active = 0) might work for both database systems.

:)


我的SQL数据库中有一个位字段"确切的数据类型是什么?正如您所指出的,在ACCESS中,-1是YES/TRUE,0是NO/FALSE.

"I have a bit field in my SQL database " what is the data type exacrly?  As you pointed out -1 is YES/TRUE in ACCESS and 0 is NO/FALSE.

由于类型转换,您可能会得到零.您是否尝试过在交互式窗口中使用debug.print显示ACTIVE值.

You may be getting a zero due to type conversions.  Have you tried to display the ACTIVE value with debug.print in your interactive window.

您可以使用布尔类型代替taht吗?

Can you use a Boolean type instead taht may be a better fit?

您还应该更正括号问题.我很惊讶这还没有产生语法错误.

You should correct the bracket issue as well.  I am surprised this does not generate a syntax error already.

希望这会有所帮助.


这篇关于我想念的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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