Solved

SELECT statement not working correctly - 500 pts.

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

752 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