Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I always seem to find what I need in previous threads without starting my own. I have started a couple but that's it..."

Geography

Where in the world do Tek-Tips members come from?
Loomah (TechnicalUser)
23 Jan 12 6:52
hi
i know i'm using the word mask (in the subject) in not quite the right context here but...

in access 2003 i would like to exclude a set of records from a query but can't quite get my head around what kind of criteria i need to use.

the format of the values to exclude is consistent and equates to
01AA/123456 or 02AA/123456
where AA can be any 2 letter combination and 123456 could be any 6 digit number (no more & no less than 6) so length is always 11.

The issue i'm struggling with is that access is reading (rightly so) the whole thing as text.

the initial filter i have used is
not like "01??/??????" and not like "02??/??????"
as using a # wildcard doesn't work.

This nearly gives me the results i want but the data includes (at least) one field in the format 01AA/123/56 and would, of course, allow for 01AA/abcdef too so can't be trusted.

any help/pointers would be much appreciated
thanks

winky smile

If a man says something and there are no women there to hear him, is he still wrong? ponder
How do I get the best answers?

Andrzejek (Programmer)
23 Jan 12 8:02
    
Your statement: not like "01??/??????" and not like "02??/??????"
should exclude the record 01AA/123/56 because:
01??/??????
01AA/123/56

it does fit the criteria, unless you have some spaces after the /56

Have fun.

---- Andy

PHV (MIS)
23 Jan 12 8:17
Loomah (TechnicalUser)
23 Jan 12 9:02
thanks guys but...
andy
that's exactly what i would have thought but the fact remains that it didn't work (for me)!  i expect the reason is that the '?' wild card (ansi-86) is any single alphabetic character and i'm guessing '/' fits that criteria, unless the fact the whole thing is one string screws everything up!  which brings me to...

phv
again i thought using the '#' wildcard was the way but access doesn't seem to see the data as a number - it isn't xl is it?!!
i hadn't thought of the 0[12][a-z] etc route but i did try using [1-9] 6 times for the second numeric part of the field but that threw up some strange results!

as i type this i might have another idea but....

winky smile

If a man says something and there are no women there to hear him, is he still wrong? ponder
How do I get the best answers?

Helpful Member!  PHV (MIS)
23 Jan 12 9:12
And this ?
NOT Like "0[12][A-Z][A-Z]/[0-9][0-9][0-9][0-9][0-9][0-9]"

Hope This Helps, PH.
FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

Loomah (TechnicalUser)
23 Jan 12 9:16
phv
was just about to post back - that was the other idea i had in my last post!!!
have just tried it and it is looking good but still have to test the results from it more thoroughly!

thanks for the input, as always

winky smile

If a man says something and there are no women there to hear him, is he still wrong? ponder
How do I get the best answers?

Andrzejek (Programmer)
23 Jan 12 10:24
    
I know it is not what you want to do (I may be wrong...) but have you considered instead of data like you have now:

01AA/123456
02AA/123456
01AA/123/56

have these in more than one column, maybe something like:

Fld1 Fld2 Fld3 Fld4 Fld5 Fld6
01   AA   /    123   4   56
02   AA   /    123   4   56
01   AA   /    123   /   56

It would be easier to deal with, IMHO

Have fun.

---- Andy

Loomah (TechnicalUser)
25 Jan 12 7:49
PH - thanks again!

Andy
I get what you're saying.  However the data comes from a 'live' system via a download and already has access bursting at the seems!  adding another 5 fields for the sake of 1 report from a dataset that should be transfered to sql server (and will be at some point) isn't practical.

cheers!

winky smile

If a man says something and there are no women there to hear him, is he still wrong? ponder
How do I get the best answers?

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close