A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

filtering in queries



 
 
Thread Tools Display Modes
  #1  
Old July 8th, 2008, 12:37 PM posted to microsoft.public.access.queries
NES
external usenet poster
 
Posts: 106
Default filtering in queries

I have a table with a field that is to be formatted as "99999-9999-999" where
the N stands for a digit: 5 digits, dash, 4 digits, dash 3 digits.

I have purposly not formatted the input field because due to government
fiddling, the format may change.

However, for the time being, I need to periodically check to see that this
format is being observed. I have created a query that uses the following
criteria:

not like "*****-****-***"

and it does find some but not all irregular entries. Is there a more
specific way of showing the format that I'm searching for in a query? That is
showing, exact placement of digits only (no alpha allowed).

I'm stumped on this one. ANy help would be most appreciated.
--
Norm Shimmel
Butler, PA
  #2  
Old July 8th, 2008, 01:10 PM posted to microsoft.public.access.queries
bhicks11 via AccessMonster.com
external usenet poster
 
Posts: 529
Default filtering in queries

To look for alpha use NOT LIKE "#"

You can use Instr() to test for the dash.

Bonnie
http://www.dataplus-svc.com

NES wrote:
I have a table with a field that is to be formatted as "99999-9999-999" where
the N stands for a digit: 5 digits, dash, 4 digits, dash 3 digits.

I have purposly not formatted the input field because due to government
fiddling, the format may change.

However, for the time being, I need to periodically check to see that this
format is being observed. I have created a query that uses the following
criteria:

not like "*****-****-***"

and it does find some but not all irregular entries. Is there a more
specific way of showing the format that I'm searching for in a query? That is
showing, exact placement of digits only (no alpha allowed).

I'm stumped on this one. ANy help would be most appreciated.


--
Message posted via http://www.accessmonster.com

  #3  
Old July 8th, 2008, 01:20 PM posted to microsoft.public.access.queries
NES
external usenet poster
 
Posts: 106
Default filtering in queries

Works like a charm. Thank you. I've actually used the dash in the string
rather than using inst(). Seems to work. Thanks again.
--
Norm Shimmel
Butler, PA


"bhicks11 via AccessMonster.com" wrote:

To look for alpha use NOT LIKE "#"

You can use Instr() to test for the dash.

Bonnie
http://www.dataplus-svc.com

NES wrote:
I have a table with a field that is to be formatted as "99999-9999-999" where
the N stands for a digit: 5 digits, dash, 4 digits, dash 3 digits.

I have purposly not formatted the input field because due to government
fiddling, the format may change.

However, for the time being, I need to periodically check to see that this
format is being observed. I have created a query that uses the following
criteria:

not like "*****-****-***"

and it does find some but not all irregular entries. Is there a more
specific way of showing the format that I'm searching for in a query? That is
showing, exact placement of digits only (no alpha allowed).

I'm stumped on this one. ANy help would be most appreciated.


--
Message posted via http://www.accessmonster.com


  #4  
Old July 8th, 2008, 01:24 PM posted to microsoft.public.access.queries
bhicks11 via AccessMonster.com
external usenet poster
 
Posts: 529
Default filtering in queries

Made my day!

Bonnie
http://www.dataplus-svc.com

NES wrote:
Works like a charm. Thank you. I've actually used the dash in the string
rather than using inst(). Seems to work. Thanks again.
To look for alpha use NOT LIKE "#"

[quoted text clipped - 20 lines]

I'm stumped on this one. ANy help would be most appreciated.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200807/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:22 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.