1

When I try to create a Report based on the following SELECT query in Micorsoft Access, i get the message "Syntax error (missing operator) in query expression 'Livestock>Mob Name/#'. The query itself works fine but when trying to put it into a report it comes up with the error.

SELECT 
    [Load DSE in Paddocks Currently].Livestock.[Mob Name/#], 
    Paddock.Paddock, Paddock.[Stocking rate], 
    [Load DSE in Paddocks Currently].Livestock.[Load(DSE)]
FROM 
    Paddock 
LEFT JOIN 
    [Load DSE in Paddocks Currently] ON Paddock.[Paddock] = [Load DSE in Paddocks Currently].[Livestock Movement].[Moved In Paddock(s)].[Value]
WHERE 
    ((([Load DSE in Paddocks Currently].[Livestock Movement].[Moved In Paddock(s)].Value) IS NOT NULL));
FROM Paddock LEFT JOIN [Load DSE in Paddocks Currently] ON Paddock.[Paddock] = [Load DSE in Paddocks Currently].[Livestock Movement].[Moved In Paddock(s)].[Value] WHERE ((([Load DSE in Paddocks Currently].[Livestock Movement].[Moved In Paddock(s)].Value) Is Not Null));'

I want the report to be grouped by Paddocks with mobs and their DSE load summed under each paddock.

4
  • Is [Load DSE in Paddocks Currently].[Livestock Movement].[Moved In Paddock(s)].[Value] a lookup or multi-value field? If so, replace it with a normal child table. Commented Sep 10, 2021 at 6:04
  • @Gustav It is a multi-value field, as there are multiple mobs within a paddock. Where would i replace it? im justs self taught, so this is all very new for me. Commented Sep 10, 2021 at 6:16
  • New to me as well, as I never use them. But I located Alternative to multi-valued fields in MS Access. Commented Sep 10, 2021 at 6:26
  • Thankyou. I have somehow managed to get it to work, but relating the query with the lookup tables. Commented Sep 10, 2021 at 8:06

1 Answer 1

1

The error message is pointing to a problem with the field [Mob Name/#]. Since this name contains a slash (/), you must quote it with square brackets. It seems that in some expression, it is written without square brackets, and thus, the slash (/) is interpreted as division, which leads to the error.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.