Exclude certian data in a query question

G

Guest

Hello all, I have a field in a table that is a text field, lets call it Order
Number.

Order number follows this format. 7 numerical digits then a dash then a mix
of two characters. Those characters can be both a letter and a number. Ex.
1234567-AJ or 1234567-A1.

My problem is I need to get all orders that have two letters following that
dash, none with numbers. I need this data for a report, so using VBA was out
of the question. Is anyone out there familiar with a method that I can use
for this?

Thank you in advance.
 
O

OfficeDev18 via AccessMonster.com

Why is VBA out of the question? I use VBA all the time to create new queries,
using the

CurrentDB.CreateQueryDef()

statement. I also use VBA a lot to add records to temporary tables to be used
as a Record Source in a report, using the RecordsetObject.AddNew method.
Don't reject the obvious, it is easier than you think.

Sam
 
J

Jeff L

Use Like "*-[A-Z][A-Z]" in your query. The Like should go in the
criteria of the field.

If you want to find the ones with just the numbers:
Like "*-[A-Z]#"

Hope that helps!
 
G

Guest

VBA is out of the question because I need the query itself to exsist. The
user's I am designing this for do not know VBA and they strictly said not to
do something they couldn't easily edit, and having them learn VBA is way out
there. Their restriction for the DB that I am stuck with, sorry.
 

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