?
Solved

SQL WHERE field LIKE any number

Posted on 2010-09-13
2
Medium Priority
?
279 Views
Last Modified: 2012-05-10
I am using
- MSAccess
- Microsoft SQL Server  2000 - 8.00.760 (Intel X86)
- FrontPage 2003

I am trying to pull a report for a list of titles that being with a number 0-9. I have the following code working for an alphabet search:

      "WHERE BookTitle LIKE 'B%' and ACTIVE LIKE 'Yes' "

Do I have to do an OR statement for each number or is there a an inclusive code?

0
Comment
Question by:JLohman
[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 Comments
 
LVL 4

Accepted Solution

by:
ericnils earned 1000 total points
ID: 33663791
Try this:

"WHERE BookTitle LIKE '[0-9]%' and ACTIVE LIKE 'Yes' "
0
 
LVL 48

Assisted Solution

by:Dale Fye
Dale Fye earned 1000 total points
ID: 33663917
Disagree with using like for an exact comparison.  Recommend:

WHERE [BookTitle] Like '[0-9]%' AND [Active] = 'Yes'
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

718 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