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.
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...
Subreddit
Post Details
- Posted
- 7 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/MSAccess/co...