查询计算字段标准未遵循 [英] Query Calculation Field Criteria Not Followed

查看:109
本文介绍了查询计算字段标准未遵循的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Access 2003中,我从头开始创建一个库存数据库。我试图在排队中使用两个表(tblProductInformation和tblSubProducts)来确定库存中的物品数量。 SubProducts表通过Item#链接到Product Information表(并且信息被添加并作为表单的产品信息与子表单子产品一起查看)


我有一个表格( frmInventoryLocation)在为Queary选择位置的情况下,如果没有选择位置,则该队列还具有返回所有位置的条件。


我在排队中有一个计算字段,用于通过从#receved中减去#Sold(SubProducts表中的两个字段)来计算库存数量。此计算工作正常。但是,我想将我的列表限制为那些库存有库存的企业(AKA有库存> 0)我已经尝试将> 0标准添加到计算字段但是排队仍然返回所有结果,即使那些没有库存的。


我设法通过创建第二个任务(QryInventoryLocation)来解决这个问题,该第二个任务包含来自第一个任务的所有字段(QryInventory)和标准为> 0的In股票领域。这有效,但要求我有两个小队做一些我认为我应该能够完成的事情。有没有人有任何想法来修复我的第一个任务''看''> 0标准?

In Access 2003 I am creating an Inventory Database from scratch. There are two tables (tblProductInformation and tblSubProducts) that I am trying to use in a queary to determine the number of Items in Stock. The SubProducts table is linked to the Product Information table by Item # (and the information is added and viewed as a form Product Information with a Sub Form Sub Products)

I have a form (frmInventoryLocation) where a location is selected for the Queary, the queary also has criteria to return all locations if no location is choosen.

There is a calculation field in the queary that I am using to calculate the number in stock by subtracting the # Sold from the # recieved (both fields in the SubProducts table). This calculation works fine. However, I want to limit my list to those enteries that have inventory in stock (AKA In Stock > 0) I have tried adding the >0 criteria to the calculated field but the queary still returns all results, even those with no stock.

I have managed to get around this by creating a second queary (QryInventoryLocation) that has all the fields from the first queary (QryInventory) and the Criteria of >0 for the In Stock field. This works but requires that I have two quearys to do something that I think I should be able to accomplish in one. Does anyone have any ideas to fix my first queary to ''see'' the >0 criteria?

推荐答案

如何粘贴SQL查询?请通过选择文本然后单击此回复窗口顶部的#按钮将其包装在代码标记中。您也可以手动编辑第一个标签,如下所示:[code = sql]


问候,

Scott
How about pasting in the SQL for your query? Please wrap it in the code tags by selecting the text and then clicking the # button on the top of this reply window. You can also manually edit the first tag to look just like this: [code=sql]

Regards,
Scott


Scott,


感谢您对此问题的回复...下面我复制并粘贴了我的任务的SQL视图,并使用#符号格式化代码按照你的要求。如果您还有其他需要评估此问题,请与我们联系。再次感谢您的帮助!!

Scott,

Thanks for your reply to this question...below I have copied and pasted the SQL view of my queary and I have used the # symbol to format the code as you requested. Please let me know if you need anything else to evaluate this issue. Thanks again for your help!!


展开 | 选择 | Wrap | 行号



Scott,


感谢您对此问题的回复...下面我复制并粘贴了我的任务的SQL视图,并使用#符号格式化你要求的代码。如果您还有其他需要评估此问题,请与我们联系。再次感谢您的帮助!!

Scott,

Thanks for your reply to this question...below I have copied and pasted the SQL view of my queary and I have used the # symbol to format the code as you requested. Please let me know if you need anything else to evaluate this issue. Thanks again for your help!!


展开 | 选择 | Wrap | 行号


这篇关于查询计算字段标准未遵循的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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