Query with special characters


C

Connie

I'm trying to figure out the best way, if any, to query on a text field that
has the following type of data. P1052.2, P1052.3, etc. I've tried replacing
the . with an * but it does not bring up a specific record, instead all the
numbers, such as, P1052.3, P1052.13, P1052.30 etc. Does anyone have a
solution or is something that would require some VB or VBA?
 
Ad

Advertisements

C

Connie

I would like to enter in the criteria P1052.3, but when I do that, I get an
error message saying that dot is not allowed.
 
C

Connie

Thank you. That worked. If I need to query many at a time, I probably will
have to create a macro first to add the double quotes prior to entering them
into the query window. Is there a way to do this directly in an access query?
 
D

Duane Hookom

It isn't clear what you are attempting to do. Generally you should use
controls on forms to enter all dynamic (changing) criteria in queries.
 
Ad

Advertisements

C

Connie

The Access database that I am using is connected by ODBC to another
application, so it is Read Only. The application does not have a very good
search feature. What I need to do is pull data using the record ID (P1052.3).
This is where I'm having the problem, because the record ID has a dot in it.
The double quote worked fine for one record at a time, but If I had many, I
would need to manually add the double quotes. Do you know of another way to
acheive this in a more automated way? I'm thinking that I would need to
export the data into Excel, then create a function that would add the double
quotes for me, then copy those number into the query window. Does that sound
like the only way to accomplish what I'm trying to do? Hopefully this makes
sense.
 
D

Duane Hookom

It sounds like you want to select many multiple, non-contiguous IDs. I would
normally use a multi-select list box. There are lots of good resources on how
to use multi-select list boxes in query criteria.
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top