MSAccessRookie
AWF VIP
- Local time
- Today, 16:36
- Joined
- May 2, 2008
- Messages
- 3,428
Greetings to all,
I have started a new project and encountered what appears to be a simple Query that causes MS Access 2003 to crash and restart. Any ideas as to where to look for the issue would be appreciated.
The Query itself does not appear to have anything obvious wrong with it, and the source of the problem seems to be the LEFT JOIN statement. If I modify the Query to use RIGHT JOIN or INNER JOIN, the code runs without error.
Is there something that I do not know about the properties of LEFT JOIN that could be causing this? I am looking into getting permission to upload a copy of the database, but that may take a while since I am a consultant and do not work for the company, so I will need approval to do so. What I can say at this time is the following:
The query in question:
LocationCodes is a Table with the following structure:
GetAcquisValues is the following Query (Loc_Code is Text):
I have started a new project and encountered what appears to be a simple Query that causes MS Access 2003 to crash and restart. Any ideas as to where to look for the issue would be appreciated.
The Query itself does not appear to have anything obvious wrong with it, and the source of the problem seems to be the LEFT JOIN statement. If I modify the Query to use RIGHT JOIN or INNER JOIN, the code runs without error.
Is there something that I do not know about the properties of LEFT JOIN that could be causing this? I am looking into getting permission to upload a copy of the database, but that may take a while since I am a consultant and do not work for the company, so I will need approval to do so. What I can say at this time is the following:
The query in question:
Code:
SELECT LocationCodes.[STATION FLOC], LocationCodes.[STATION NAME]
FROM LocationCodes LEFT JOIN GetAcquisValues ON LocationCodes.[LOCATION CODE]=cCur(GetAcquisValues.Loc_Code)
WHERE LocationCodes.[STATION FLOC] IS NOT Null AND GetAcquisValues.Loc_Code IS NULL
GROUP BY LocationCodes.[STATION FLOC], LocationCodes.[STATION NAME];
LocationCodes is a Table with the following structure:
Code:
[LOCATION CODE] Number
[LOCATION NAME] Text
[STATION CODE] Text
[STATION NAME] Text
GetAcquisValues is the following Query (Loc_Code is Text):
Code:
SELECT Loc_Code, Sum(NumDC10Assets) AS NumberOfDC10Assets, Sum(NumTC10Assets) AS NumberOfTC10Assets, Sum(NumDC10Assets)+Sum(NumTC10Assets) AS NumberOfTotalAssets, Sum(DC10Value) AS DC10Acquis_Value, Sum(TC10Value) AS TC10Acquis_Value, (Sum(DC10Value)+Sum(TC10Value)) AS TotalAcquis_Value
FROM AcquisCombinedValues
GROUP BY Loc_Code;