Solved

SELECT statement not working correctly - 500 pts.

Posted on 2007-04-07
2
168 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
spx for moving values to new table 5 75
Restrict result set 1 44
CROSS APPLY 4 61
Urgent help needed! Unable to to paste in query designer 29 55
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

749 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