Solved

SELECT statement not working correctly - 500 pts.

Posted on 2007-04-07
2
158 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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
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…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 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

14 Experts available now in Live!

Get 1:1 Help Now