?
Solved

Useing Masks in a Query

Posted on 2002-07-03
3
Medium Priority
?
182 Views
Last Modified: 2011-10-03
I want to check if the data in a specific column in my database applies to a certain input mask. I don’t want to loop trough every record but to use a SQL query like “SELECT * FROM border_Att WHERE drawingnr =  000/??-####” or something like that.

Please help.
0
Comment
Question by:WNE
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 1600 total points
ID: 7126520
Is this on SQL Server? If so you can use this:

"Select * From border_Att Where drawingnr Like '[0-9][0-9][0-9]/__-%'"
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 7126524
This will match three numbers followed by "/" then any two characters then a hyphen then any characters.

You can also use [A-Z] to specify alphabetic characters or equally any range of printable characters.
0
 
LVL 1

Author Comment

by:WNE
ID: 7126732
That's it. Thanks!
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question