Solved

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

Posted on 2007-03-22
2
230 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how the fundamental information of how to create a table.

756 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