嘿,下面的存储访问查询在通过 VBA excel 运行时给出带有“ NA ”的 POEventCode,并且在直接从 access 运行时给出正确的结果。为什么这是异常?
SELECT D.[Event Code] & D.[Week Code] AS POEventCode, *
INTO A
FROM (SELECT IIf([Advertisement type]='Tabloide','TAB',
IIf([Advertisement type]='Flyer','FLY','NA')) AS [Event Code],
IIf(([Start Date]>[SD] And [Start Date]<[ED]),
[Month] & Right([WM_WK],2),'NA')
AS [Week Code], *
FROM [Feature A-Traits] AS C, [Event Code] AS B)
AS D
WHERE (D.[Week Code]) Not Like '*NA*'
And (D.[Event Code]) Not Like '*NA*';