Solved

What criteria would I use for my ODBC query

Posted on 2013-06-17
3
282 Views
Last Modified: 2013-07-16
I have an ODBC query pulling my data. One of the columns with data looks has 5 numbers, a slash (/), then 6 more numbers. I need to create criteria for both the 5 numbers before the slash and another criteria for the 6 numbers after the slash. So the data looks like this, 11111/222222. So, I need 2 criterias pulling the same column. One criteria i would put 11111, the other criteria i would put 222222. I thought i would use the function "Like", but that isn't working for some reason. I can't use criteria with Begins With or Ends With. How would i accomplish this??? Thanks!
0
Comment
Question by:brasiman
3 Comments
 
LVL 6

Accepted Solution

by:
ianmills2002 earned 250 total points
ID: 39255084
In your query you can use the SUBSTRING() function

....
AND SUBSTRING(column, 1, 5) = '11111'
AND SUBSTRING(column, 6, 6) = '222222'
....
0
 
LVL 24

Assisted Solution

by:Steve
Steve earned 250 total points
ID: 39255394
You should be able to use Like:

column LIKE '11111/%' OR column LIKE '%/222222'
(Have used OR as not sure if AND is correct)
0
 

Author Comment

by:brasiman
ID: 39330473
They actually both work for how i was wanting to use it. Thank you!
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

Hi, I am very much excited today since I'm going to share something very exciting Tool used for Analytical Reporting and that's nothing but MICROSTRATEGY. Actually there are lot of other tools available in the market for Reporting Such as Co…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

708 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

12 Experts available now in Live!

Get 1:1 Help Now