Query Question

G

Guest

I trying to search between a rang of GL codes. The format of the codes are XXXX-XXX-XX. Without the dashes of course in the table. I want to find all records where the GL codes are between XXXX-100-XX and XXXX-108-XX. The X being any numbers. I've tried playing around with Like but have had luck as of yet. Any help would be greatly appreciated.
 
L

Les

You could try putting this in criteria for your field.

Mid([field],5,3) Between "100" And "108"
-----Original Message-----
I trying to search between a rang of GL codes. The
format of the codes are XXXX-XXX-XX. Without the dashes
of course in the table. I want to find all records where
the GL codes are between XXXX-100-XX and XXXX-108-XX. The
X being any numbers. I've tried playing around with Like
but have had luck as of yet. Any help would be greatly
appreciated.
 
J

John Spencer (MVP)

Are the GL Codes stored in a text/string field? If so, add a calculated field
to your query and check against that.

Field: NumPart: Mid(YourField,5,3)

Criteria: Between "100" and "108"

Or
Field: NumPart: Val(Mid(YourField,5,3))

Criteria: Between 100 and 108
 

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