Criteria in Query

margt_a

Registered User.
Local time
Today, 02:19
Joined
Aug 15, 2002
Messages
35
I have a query that sorts project numbers with a Mid expression:

Mid([tblProject.ProjectNumber],2,5)

The second and third numbers represent the year: -02----.

How can I use the query criteria to return records for only one year? Or does the >= statement belong in the Mid expression?

Help!

Margaret
 
Have your expression be in a field on it's own. Then put your criteria in for that field.

MyYear: Mid([tblProject.ProjectNumber],2,5)
In the criteria, put in 02.

You may have to have one query with the field put in and then create another query based on the first query where you put in the criteria ... Sometimes Access doesn't play well when putting criteria on expressions.
 
Worked around.

It wouldn't let me run criteria in the expression field, so I put the following in the Project Number field:

Like "103*" Or Like "203*" Or Like "303*" Or Like "403*"

A bit long, but it worked and I'm not complaining.

Thanks for your help,
Margaret
 

Users who are viewing this thread

Back
Top Bottom