Solved

What criteria would I use for my ODBC query

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

895 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

15 Experts available now in Live!

Get 1:1 Help Now