Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Syntax for selecting partial row

Posted on 2008-10-16
2
Medium Priority
?
168 Views
Last Modified: 2012-05-05
I'm trying to query a column in my table called invoice.  Which has data like:

123
154
14235
123-old

ect....

I only want to get the ones that have a "-old" on them.  Below is what I'm trying for but the * doesn't work the way I need it to.

select InvoiceNo
from DebtorService
where Invoiceno = *-old
0
Comment
Question by:Nathan Riley
2 Comments
 
LVL 17

Accepted Solution

by:
Daniel Reynolds earned 2000 total points
ID: 22734854
select InvoiceNo
from DebtorService
where Invoiceno LIKE '%-old'
0
 
LVL 12

Author Closing Comment

by:Nathan Riley
ID: 31506884
Perfect, thanks.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

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. …
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how the fundamental information of how to create a table.

783 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