Solved

SELECT statement not working correctly - 500 pts.

Posted on 2007-04-07
2
161 Views
Last Modified: 2010-03-19
I have the following SQL statement:

select max(BookNbr) from tBooks where isnumeric(BookNbr) = 1

where BookNbr is defined as PK, varchar(15).

When I start from zero (empty), the select statement returns "9", when the highest number is "10".  I have tried removing the "where" clause and changing it to >0, but stills returns "9".

What am I doing wrong?
0
Comment
Question by:rmmarsh
2 Comments
 
LVL 39

Accepted Solution

by:
appari earned 500 total points
ID: 18869551
try

select max(convert(numeric(15,0),BookNbr)) from tBooks where isnumeric(BookNbr) = 1
0
 

Author Comment

by:rmmarsh
ID: 18869632
Thank you so much... works like a champ!
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Question has a verified solution.

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

Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

867 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