Solved

Help with SQL statment that only includes records without a # at the start of the string.

Posted on 2007-03-22
2
195 Views
Last Modified: 2009-12-16
I have a table (GL_Account) with two columns that I want to retreive Account & AccountDesc.  Both are type Char.  I want to select only the rows that the Account does not end in 0 and the AccountDesc does not start with #.



0
Comment
Question by:flg8tor96
2 Comments
 
LVL 16

Accepted Solution

by:
rboyd56 earned 250 total points
ID: 18771213
How about

select * from GL_Account where RIGHT(account,1) <> '0' and LEFT(AccountDesc,1) <> '#'
0
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 250 total points
ID: 18771233
select * from GL_Account where AccountDESC like '#%' and amount like '%0'
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

759 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

21 Experts available now in Live!

Get 1:1 Help Now