位置,位置,位置 [英] Location, Location, Location

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

问题描述

我是新手并且正在尝试从我们的主计算机系统中检索一些数据。

我要做的是找到不在两个位置的任何库存。 />
我有一个inv.loc表,其中包含我需要的所有字段。当我加入标准Not = 10 and 11821时它不会带回正确的数据。

解决方案

在查询条件中尝试(<> 10和<> 11821)。

作为补充,请转到查询的SQL视图,我认为访问中的构建器在某些方面很简洁,但对于经验丰富的SQL大师来说,它是一个非常有限的工具。 SQL本身并不困难,它可以像你一样复杂,SELECT语句很容易构造。该工具可以方便地将这些讨厌的连接填充到您的查询中。有些人对使用哪种连接,内部连接,交叉连接以及列表继续(以及继续)感到困惑。认真地尝试学习生成的SQL脚本,并且您将能够访问下一级别,您甚至可以迁移到功能更强大的SQL Server,(当您查看65,000条记录时,访问会讨厌它) 。


感谢您的回复。

我尝试了<> 10 And<> 11821并没有带回任何结果当我知道只有两个位置之一的项目。

我也查看了SQL语句,看起来看起来是正确的。


SELECT dbo_p21_view_inv_loc.item_id,dbo_p21_view_inv_loc.primary_supplier_id,dbo_p21_view_inv_loc.location_id

来自dbo_p21_view_inv_loc

GROUP BY dbo_p21_view_inv_loc.item_id,dbo_p21_view_inv_loc.primary_supplier_id

。具有(((dbo_p21_view_inv_loc.primary_supplier_id)= 11235)AND((dbo_p21_view_inv_loc.location_id)LT;大于10和(dbo_p21_view_inv_loc.location_id)LT;> 11821))

ORDER BY dbo_p21_view_inv_loc.item_id;


我们将不胜感激。


I am a novice and am trying to retrieve some data from our main computer system.
What I''m trying to do is locate any inventory that is not located in both locations.
I have an inv.loc table that has all the fields I need. When I put in the criteria "Not = 10 and 11821" it does not bring back the correct data.

解决方案

Try (<> 10 And <> 11821) in the criteria of the query.


As a supplement to that, go to the SQL view of your query, I think that the builder in access is neat in certain aspects, but for an experienced SQL guru, it''s a very limiting tool. SQL itself isn''t difficult, it can be as complex as you like, SELECT statements are easy to construct. The tool is handy for stuffing those pesky joins into your query though. Some people get confused as to which kind of join to use, an inner join, cross join, and the list goes on (and on). Seriously try to learn the SQL Script that is generated, and you''ll be able to take access to the next level, you could even migrate to the more powerful SQL Server, (access hates it when you go over something like 65,000 records).


Thanks for the replies.
I tried the <>10 And <> 11821 and it didn''t bring back any results when I know ther e are items in only one of two locations.
I also looked at the SQL statement and it appears to look correct.

SELECT dbo_p21_view_inv_loc.item_id, dbo_p21_view_inv_loc.primary_supplier_id, dbo_p21_view_inv_loc.location_id
FROM dbo_p21_view_inv_loc
GROUP BY dbo_p21_view_inv_loc.item_id, dbo_p21_view_inv_loc.primary_supplier_id
HAVING (((dbo_p21_view_inv_loc.primary_supplier_id)=11235 ) AND ((dbo_p21_view_inv_loc.location_id)<>10 And (dbo_p21_view_inv_loc.location_id)<>11821))
ORDER BY dbo_p21_view_inv_loc.item_id;

Any other help would be appreciated.


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

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