Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

3
Syntax error (missing operator) in query expression 'xxxxxx'
Post Flair (click to view more posts with a particular flair)
Post Body

Hi all,

I am new to Access but unfortunately google hasn't helped me fix this problem - apologies if this is a simple fix.

In essence I have three fields/columns I want to extract from a large database: "ID", "Vehicle ID" and "Year".

These fields are described in more detail below:

ID: 5 digit number, e.g.21456

Vehicle ID: XXXX#######* (four letters followed by a variable length of numbers)

Year: #### (e.g. 2016)

My SQL code is as below:

SELECT ID, [Vehicle ID], Year
        FROM Test
        WHERE [Vehicle ID] LIKE 'ABCD*' OR [Vehicle ID] LIKE 'EFGH*'

The result works - I get only results where vehicleID starts with ABCD and EFGH, however, I without fail get the error in the title "Syntax error (missing operator) in query expression 'VehicleID' " when I click on the top of the column to sort it.

I am stumped given that is the entirety of the code - would the data in the "VehicleID" field cause an issue, or is there something wrong with the code itself?

Also bonus question (for when this is hopefully fixed). Is there a way to apply this filter on VehicleID for say, 10 or 100 ABCD* style criteria with ease?

Really appreciate any help with this!

Thanks

Edit: I also get this trying to use the query wizard if that means much...

Author
Account Strength
90%
Account Age
13 years
Verified Email
Yes
Verified Flair
No
Total Karma
751
Link Karma
16
Comment Karma
735
Profile updated: 1 day ago
Posts updated: 4 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
7 years ago