Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 访问已存在关系的Dlookup_Sql_Ms Access 2010 - Fatal编程技术网

Sql 访问已存在关系的Dlookup

Sql 访问已存在关系的Dlookup,sql,ms-access-2010,Sql,Ms Access 2010,我有一个事实表,它有一个主键结束项代码和一个外键开始项代码。主键与dim表项信息表保持连接,外键也可以在该表中。我想得到一个列Dlookup'd,而不是创建另一个查询来连接到我的事实表,但我认为我的语法不正确,而且我找不到任何关于像这样使用Dlookup的人的信息。我做错了什么 特定DLOOKUP代码: DLOOKUP(" [Descripition] "," [DIM TABLE] ", " FT.[Starting Item Code] = DT.[Item Code] ") AS [Sta

我有一个事实表,它有一个主键
结束项代码
和一个外键
开始项代码
。主键与dim表项信息表保持连接,外键也可以在该表中。我想得到一个列Dlookup'd,而不是创建另一个查询来连接到我的事实表,但我认为我的语法不正确,而且我找不到任何关于像这样使用Dlookup的人的信息。我做错了什么

特定DLOOKUP代码:

DLOOKUP(" [Descripition] "," [DIM TABLE] ", " FT.[Starting Item Code] = DT.[Item Code] ") AS [Start Item Description]
事实表:

Starting Item Code | Ending Item Code
_____________________________________
1050                 1051
Item Code | Description
_______________________
1050        Chum
1051        Krabby Paddies
SELECT

FT.Starting Item Code,
FT.Ending Item Code,
DT.Description AS [Ending Item Description],

DLOOKUP(" [Descripition] "," [DIM TABLE] ", " FT.[Starting Item Code] = DT.[Item Code] ") AS [Start Item Description]

FROM [Fact Table] AS FT

LEFT JOIN [Dim Table] AS DT
ON FT.[Ending Item Code] = DT.[Item Code]
Starting Item Code | Starting Item Description | Ending Item Code | Ending Item Description
____________________________________________________________________________________________
1050                 Chum                        1051               Krabby Paddies
暗表:

Starting Item Code | Ending Item Code
_____________________________________
1050                 1051
Item Code | Description
_______________________
1050        Chum
1051        Krabby Paddies
SELECT

FT.Starting Item Code,
FT.Ending Item Code,
DT.Description AS [Ending Item Description],

DLOOKUP(" [Descripition] "," [DIM TABLE] ", " FT.[Starting Item Code] = DT.[Item Code] ") AS [Start Item Description]

FROM [Fact Table] AS FT

LEFT JOIN [Dim Table] AS DT
ON FT.[Ending Item Code] = DT.[Item Code]
Starting Item Code | Starting Item Description | Ending Item Code | Ending Item Description
____________________________________________________________________________________________
1050                 Chum                        1051               Krabby Paddies
SQL代码:

Starting Item Code | Ending Item Code
_____________________________________
1050                 1051
Item Code | Description
_______________________
1050        Chum
1051        Krabby Paddies
SELECT

FT.Starting Item Code,
FT.Ending Item Code,
DT.Description AS [Ending Item Description],

DLOOKUP(" [Descripition] "," [DIM TABLE] ", " FT.[Starting Item Code] = DT.[Item Code] ") AS [Start Item Description]

FROM [Fact Table] AS FT

LEFT JOIN [Dim Table] AS DT
ON FT.[Ending Item Code] = DT.[Item Code]
Starting Item Code | Starting Item Description | Ending Item Code | Ending Item Description
____________________________________________________________________________________________
1050                 Chum                        1051               Krabby Paddies
我想要的查询结果:

Starting Item Code | Ending Item Code
_____________________________________
1050                 1051
Item Code | Description
_______________________
1050        Chum
1051        Krabby Paddies
SELECT

FT.Starting Item Code,
FT.Ending Item Code,
DT.Description AS [Ending Item Description],

DLOOKUP(" [Descripition] "," [DIM TABLE] ", " FT.[Starting Item Code] = DT.[Item Code] ") AS [Start Item Description]

FROM [Fact Table] AS FT

LEFT JOIN [Dim Table] AS DT
ON FT.[Ending Item Code] = DT.[Item Code]
Starting Item Code | Starting Item Description | Ending Item Code | Ending Item Description
____________________________________________________________________________________________
1050                 Chum                        1051               Krabby Paddies