Help with "Like" Criteria

G

Guest

I'm attempting to query a field containing and ID number which contains a
date for a specific year: Example: LN1105072
Where "LN" = Initials, "110507" the date I'm after, and the "2" an employee
number.
I can set the criteria as: Like "*" & [Enter Date Desired] & "*"
and pull a specific date but would like to be able to pull all of 2007
somehow. To do this I need to be able to ask specifically for positions 7 and
8 of this ID number. Could someone please shed some light? Thanks!
 
J

John Spencer

Field: IdNumber
Criteria: Like "??????" & [Enter 2-Digit Year & "*"

OR this alternative

Field: Mid(IDNumber,7,2)
Criteria: [Enter 2-Digit Year]

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
G

Guest

Perfect! Thanks John.
--
If you can read this, thank a Teacher...
If your reading it in English, thank a Veteran!


John Spencer said:
Field: IdNumber
Criteria: Like "??????" & [Enter 2-Digit Year & "*"

OR this alternative

Field: Mid(IDNumber,7,2)
Criteria: [Enter 2-Digit Year]

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Telobamipada said:
I'm attempting to query a field containing and ID number which contains a
date for a specific year: Example: LN1105072
Where "LN" = Initials, "110507" the date I'm after, and the "2" an
employee
number.
I can set the criteria as: Like "*" & [Enter Date Desired] & "*"
and pull a specific date but would like to be able to pull all of 2007
somehow. To do this I need to be able to ask specifically for positions 7
and
8 of this ID number. Could someone please shed some light? Thanks!
 

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