Solved

Useing Masks in a Query

Posted on 2002-07-03
3
180 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
  • 2
3 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 400 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

726 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