Query Question

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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.
 
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
 
Back
Top