Forum Discussion
Query problem in Access
SELECT Volunteers.FirstName, Volunteers.LastName, Volunteers.PhoneNumber, Volunteers.MobilePhone
FROM Volunteers
WHERE (((Volunteers.LastName)="C*"));
We are almost there.
General rule is that a comparison using a wildcard needs to be done using Like, whereas a comparison based on an exact match needs to be done using =
Once we cleared the problem with Access converting Like to ALike because of the ANSI92 option being set, we can now write it correctly as:
WHERE (((Volunteers.LastName) Like "C*"));
- Tena_YoungerJun 13, 2020Copper Contributor
OK. Thank you for all your help. I can now continue my class before we end in a couple of weeks.
- George HepworthJun 13, 2020Steel Contributor
Tena_Younger I'm not entirely sure how to make the option permanent because I don't know how it's being flipped back to ANSI92.
- Tena_YoungerJun 13, 2020Copper Contributor
I went to options again, removed the check mark and I am going into the query design to reenter the info again.
The info came up and the Like came in front of the C*. How can I be sure the check mark does not return again.
This is what i have been waiting for. Thank you.
- George HepworthJun 13, 2020Steel Contributor
What, specifically, did you do between the two screenshots?What I need is not statements of outcomes, (...can't get results...) but the actual steps taken.
Thanks.
- Tena_YoungerJun 13, 2020Copper Contributor
It is unchecked again. See attached.
It is checked again.
I cannot get results either way.
- George HepworthJun 13, 2020Steel Contributor
Tena_Younger The first suggestion we got was pretty simple and straightforward.
Close the accdb.
Close MS Access entirely.
Restart MS Access.
Open this accdb, but do NOTHING else.
Check the options again.
What do you see now?
- Tena_YoungerJun 13, 2020Copper Contributor
ok thanks,
- George HepworthJun 13, 2020Steel Contributor
What changed? If it was unchecked, and now it's again checked and greyed out so it can't be changed, something else has to be going on. I've never heard of anything similar and am at a loss as to why that might happen.
I am going to call on the cavalry and see if we can find some additional insight. - Tena_YoungerJun 13, 2020Copper Contributor
- George HepworthJun 13, 2020Steel Contributor
Tena_Younger Sorry, I keep forgetting we're just getting started. So your Options now look like this, correct?
If so, you should now be able to write a criteria as WHERE LastName Like "C*" and have it run correctly.