Solved

What criteria would I use for my ODBC query

Posted on 2013-06-17
3
289 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
[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
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
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 …
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

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