我有一个使用艾伦·布朗(Allen Browne)串联方法的函数
http://allenbrowne.com/func-concat.html
代码有效,并且在我的查询中也很好。
但是,当我尝试对联合查询左联接Concatenate查询时,出现20
弹出式窗口,指出一个错误,然后该查询打开,显示信息...非常奇怪。此刻,我通过在连续表单中使用Dlookup
来解决此问题。
我尝试修改整数和字符串之间的语法,但发生了相同的错误。
我尝试将concat函数合并到一个查询中,然后再加入该查询,同样的问题。
查询,我想加入主查询。
SELECT
tblCUSTOMERREF.aglgrnID,
tblCUSTOMERREF.CustomerRef,
ConcatRelated("CustomerRef", "tblCUSTOMERREF", "[aglgrnID] = " & [aglgrnID]) AS
CustomerRefs
FROM
tblCUSTOMERREF;
主要查询-只需从任何地方提取信息...
SELECT
AGLGRNextended.*,
([tblPRODUCT].[productSUPPLIERSKU]&" - "&[tblPRODUCT].[productDESCRIPTION])AS Description,
tblPRODUCT.[productSUPPLIERNAME], tblAGLGRN.[aglgrnCREATED],
tblSCANIN.[scaninUSER], tblSCANIN.[scaninUSERTIME], tblUser.[UserName],
tblUser.[UserFIRSTNAME], Val(AGLGRNextended.[PROD]) AS PROD1,
Format(tblAGLGRN.aglgrnDATEEXPECTED,'Short Date') AS DateExpected,
tblAGLGRN.aglgrnUSER AS AGLGRNUSER,
tblUser.UserFIRSTNAME AS AGLGRNFIRSTNAMEUSER
FROM
(((((AGLGRNextended LEFT JOIN tblPRODUCT ON [tblPRODUCT].[productGS1SKU]=[AGLGRNextended].[GS1SKU])
LEFT JOIN tblAGLGRN ON [AGLGRNextended].[AGLGRN]=Format(tblAGLGRN.AGLGRN,'00000'))
LEFT JOIN tblSCANIN ON [tblSCANIN].[ID]=[AGLGRNextended].[SCANINID])
LEFT JOIN tblUser ON [tblUser].[UserLogin]=[tblAGLGRN].[aglgrnUSER]))
LEFT JOIN CustomerRefqry ON Format([CustomerRefqry].[aglgrnID],'00000') = Format(tblAGLGRN.AGLGRN,'00000')
UNION SELECT
Null AS Field2,
tblCOMPANYDIRECTORY.companyCODE AS Field3,
Format(tblAGLGRN.AGLGRN,'00000') AS AGLGRN,
Null AS Field4, Null AS Field5,
Null AS Field6, Null AS Field7,
tblAGLGRN.aglgrnCUSTOMERREF,
tblAGLGRN.aglgrnSUPPLIERREF,
tblAGLGRN.companyID,
Null AS Field9,
PackageCountqry.PackageQty AS Packages,
Null AS Field10,
Null AS Field11, Null AS Field12,
Null AS Field13, Null AS Field14,
Null AS Field15, Null AS Field16,
Null AS Field17, Null AS Field18,
tblAGLGRN.aglgrnSUPPLIER AS Field19,
tblAGLGRN.aglgrnCREATED AS Field20,
Null AS Field21,
Null AS Field22,
Null AS Field23,
Null AS Field24,
Null AS Field25,
tblAGLGRN.aglgrnDATEEXPECTED AS DateExpected,
tblAGLGRN.aglgrnUSER AS Field26,
tblUser.UserFIRSTNAME AS AGLGRNFIRSTNAMEUSER
FROM
(((((tblAGLGRN LEFT JOIN GS1DECODEextended ON Format(tblAGLGRN.AGLGRN,'00000') = Format(GS1DECODEextended.[AGL GRN],'00000'))
LEFT JOIN tblPACKAGES ON Format(tblAGLGRN.AGLGRN,'00000') = Format(tblPACKAGES.aglgrnID,'00000'))
LEFT JOIN PackageCountqry ON Format(tblAGLGRN.AGLGRN,'00000') = Format(PackageCountqry.AGLGRNPACKAGE,'00000'))
LEFT JOIN tblUser ON tblUser.UserLogin = tblAGLGRN.aglgrnUSER)
LEFT JOIN tblCOMPANYDIRECTORY ON tblAGLGRN.companyID = tblCOMPANYDIRECTORY.ID)
LEFT JOIN CustomerRefqry ON Format([CustomerRefqry].[aglgrnID],'00000') = Format(tblAGLGRN.AGLGRN,'00000')
WHERE
Format(tblAGLGRN.AGLGRN,'00000') <> Format(GS1DECODEextended.[AGL GRN],'00000')
ORDER BY
AGLGRNextended.[AGLGRN] DESC;
[aglgrnID] =
是语法问题。 tblCUSTOMERREF
并没有给我这个,只有在我将其加入表格时才给我。
所以我不知道我在想什么...