Clarkie001
IS-IT--Management
Hi,
I have a field ina query in which I lookup up another table to return a number based on a project code.
The issue I am getting is it will only return the same number for each row, when there are clearly more than one project number.....I can't see what the problem is.
any help in this matter will be greatly appreciated.
Here is the sql of the query.
SELECT FMS_Data.Date, FMS_Data.FMS_ID, [FMS_Data]![Campaign_Code] & [FMS_Data]![Source_Code] AS Campaign_Source, Int(DLookUp("[APPLIC_ID]","FMS_CODES","[Campaign_Source]=[FMS_CODES].[Campaign_Source]") AS APPLIC_ID INTO FMS_Sales_mtbl
FROM AGENT_DETAILS INNER JOIN (FMS_Data INNER JOIN CURR_REPOR ON FMS_Data.Date = CURR_REPOR.REPOR_DATE) ON AGENT_DETAILS.FMS_ID = FMS_Data.FMS_ID
GROUP BY FMS_Data.Date, FMS_Data.FMS_ID, [FMS_Data]![Campaign_Code] & [FMS_Data]![Source_Code], Int(DLookUp("[APPLIC_ID]","FMS_CODES","[Campaign_Source]=[FMS_CODES].[Campaign_Source]")
HAVING ((([FMS_Data]![Campaign_Code] & [FMS_Data]![Source_Code]) In (select Campaign_Source from FMS_CODES where Disabled=false)));
Thanks
Clarkie
I have a field ina query in which I lookup up another table to return a number based on a project code.
The issue I am getting is it will only return the same number for each row, when there are clearly more than one project number.....I can't see what the problem is.
any help in this matter will be greatly appreciated.
Here is the sql of the query.
SELECT FMS_Data.Date, FMS_Data.FMS_ID, [FMS_Data]![Campaign_Code] & [FMS_Data]![Source_Code] AS Campaign_Source, Int(DLookUp("[APPLIC_ID]","FMS_CODES","[Campaign_Source]=[FMS_CODES].[Campaign_Source]") AS APPLIC_ID INTO FMS_Sales_mtbl
FROM AGENT_DETAILS INNER JOIN (FMS_Data INNER JOIN CURR_REPOR ON FMS_Data.Date = CURR_REPOR.REPOR_DATE) ON AGENT_DETAILS.FMS_ID = FMS_Data.FMS_ID
GROUP BY FMS_Data.Date, FMS_Data.FMS_ID, [FMS_Data]![Campaign_Code] & [FMS_Data]![Source_Code], Int(DLookUp("[APPLIC_ID]","FMS_CODES","[Campaign_Source]=[FMS_CODES].[Campaign_Source]")
HAVING ((([FMS_Data]![Campaign_Code] & [FMS_Data]![Source_Code]) In (select Campaign_Source from FMS_CODES where Disabled=false)));
Thanks
Clarkie