Wildcard Criteria

G

Graham Haughs

I am not sure if this is the right group for this so apologies in advance
although I think I am in the right place.I have a text field up to 50
characters in a database. Any entry in this field, once the matter has been
dealt with will have an asterix put in front on the first letter of text to
identify that record as finished although it still needs to be stored. What
I want to do is set up a selection criteria which will select all the
records which DO NOT have an asterix at the start of the field. I can do it
in excel but entering 'Does not begin with' ~*
but do not know how to do it or if it can be done in Access.
I would welcome any guidance.

Kind Regards,
Graham Haughs
Turriff, Scotland
 
B

Brendan Reynolds

SELECT tblTest.TestText
FROM tblTest
WHERE (((tblTest.TestText) Not Like "[*]*"));

The square brackets cause the first asterisk to be treated as a literal
character and not as a wildcard.

BTW: It would be a much better design to add a 'Finished' Yes/No field for
this purpose. A good general rule is: "One field, one attribute".

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
J

Jeff C

I would approach your matter differently. My intial thought would be to add
yes/no field (check box). Use that as your criteria for "completed matter".
To my way of thinking...messing with your text narrative is not the way to
go. you will be able to search/filter/query on your new yes/no field.
 
F

fredg

I am not sure if this is the right group for this so apologies in advance
although I think I am in the right place.I have a text field up to 50
characters in a database. Any entry in this field, once the matter has been
dealt with will have an asterix put in front on the first letter of text to
identify that record as finished although it still needs to be stored. What
I want to do is set up a selection criteria which will select all the
records which DO NOT have an asterix at the start of the field. I can do it
in excel but entering 'Does not begin with' ~*
but do not know how to do it or if it can be done in Access.
I would welcome any guidance.

Kind Regards,
Graham Haughs
Turriff, Scotland

If I understand you correctly, you wish to know if the first character
in the field is an asterisk "*".

If so, as criteria:
Left([FieldName],1) <> "*"
 
G

Graham Haughs

Many thanks for that Brendan. I totally accept what you are saying about the
Yes/No field but this was originally designed by a committee!, of which I
had no part, and secured, so I am just trying to create a query to help my
secretary out. I could have called it as a query into Excel where I am
happier working but again the secure linking in the relevant tables won't
let me.

Thanks again
Graham

Brendan Reynolds said:
SELECT tblTest.TestText
FROM tblTest
WHERE (((tblTest.TestText) Not Like "[*]*"));

The square brackets cause the first asterisk to be treated as a literal
character and not as a wildcard.

BTW: It would be a much better design to add a 'Finished' Yes/No field for
this purpose. A good general rule is: "One field, one attribute".

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.


Graham Haughs said:
I am not sure if this is the right group for this so apologies in advance
although I think I am in the right place.I have a text field up to 50
characters in a database. Any entry in this field, once the matter has
been
dealt with will have an asterix put in front on the first letter of text
to
identify that record as finished although it still needs to be stored.
What
I want to do is set up a selection criteria which will select all the
records which DO NOT have an asterix at the start of the field. I can do
it
in excel but entering 'Does not begin with' ~*
but do not know how to do it or if it can be done in Access.
I would welcome any guidance.

Kind Regards,
Graham Haughs
Turriff, Scotland
 
B

Brendan Reynolds

I understand. Sometimes we just have to work with what we're given.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.


Graham Haughs said:
Many thanks for that Brendan. I totally accept what you are saying about
the
Yes/No field but this was originally designed by a committee!, of which I
had no part, and secured, so I am just trying to create a query to help my
secretary out. I could have called it as a query into Excel where I am
happier working but again the secure linking in the relevant tables won't
let me.

Thanks again
Graham

Brendan Reynolds said:
SELECT tblTest.TestText
FROM tblTest
WHERE (((tblTest.TestText) Not Like "[*]*"));

The square brackets cause the first asterisk to be treated as a literal
character and not as a wildcard.

BTW: It would be a much better design to add a 'Finished' Yes/No field
for
this purpose. A good general rule is: "One field, one attribute".

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible
for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.


Graham Haughs said:
I am not sure if this is the right group for this so apologies in
advance
although I think I am in the right place.I have a text field up to 50
characters in a database. Any entry in this field, once the matter has
been
dealt with will have an asterix put in front on the first letter of
text
to
identify that record as finished although it still needs to be stored.
What
I want to do is set up a selection criteria which will select all the
records which DO NOT have an asterix at the start of the field. I can
do
it
in excel but entering 'Does not begin with' ~*
but do not know how to do it or if it can be done in Access.
I would welcome any guidance.

Kind Regards,
Graham Haughs
Turriff, Scotland
 
G

Graham Haughs

Thanks Fred, that one fits in nicely and does the job perfectly.
Graham


fredg said:
I am not sure if this is the right group for this so apologies in advance
although I think I am in the right place.I have a text field up to 50
characters in a database. Any entry in this field, once the matter has been
dealt with will have an asterix put in front on the first letter of text to
identify that record as finished although it still needs to be stored. What
I want to do is set up a selection criteria which will select all the
records which DO NOT have an asterix at the start of the field. I can do it
in excel but entering 'Does not begin with' ~*
but do not know how to do it or if it can be done in Access.
I would welcome any guidance.

Kind Regards,
Graham Haughs
Turriff, Scotland

If I understand you correctly, you wish to know if the first character
in the field is an asterisk "*".

If so, as criteria:
Left([FieldName],1) <> "*"
 

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