Solved

Useing Masks in a Query

Posted on 2002-07-03
3
177 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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 …
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now