Solved

SELECT statement not working correctly - 500 pts.

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 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