Solved

IS NUMBER

Posted on 2002-06-26
10
244 Views
Last Modified: 2008-03-06
ok i have a varchar field that i am trying to push into another table.

i have text characters; and when i see these; i would like to filter these (out)--

right now i am using this where clause
'WHERE BUDCSI NOT LIKE '' AND BUDCSI NOT LIKE '' AND BUDCSI NOT LIKE '' AND BUDCSI NOT LIKE ''

and i want a better way to do this.

in access; i would have said 'where IsNumeric(BUDCSI) = TRUE'


INSERT INTO RASB.dbo.tblBudget
                      (BUDID, Prid, CCID, BUDCBI, BUDCSI, BudCO, BUDName, BudValue, BUDLab, BudBurden, BUDMat, BUDSub, BUDVDID, Submittal, SubmitalTitle,
                      SubmitBy, SubmitCSI, ContractORpo, BudCoid, BudMatAdj, BudLabAdj, BudSubAdj, BudAdjId, BudCTD, BudCTC, AccountStatus, BudRev, BudCom,
                      budrevcom, BudOldAdj)
SELECT     BUDID, Prid, CCID, BUDCBI, BUDCSI, BudCO, BUDName, BudValue, BUDLab, BudBurden, BUDMat, BUDSub, BUDVDID, Submittal, SubmitalTitle,
                      SubmitBy, SubmitCSI, ContractORpo, BudCoid, BudMatAdj, BudLabAdj, BudSubAdj, BudAdjId, BudCTD, BudCTC, AccountStatus, BudRev, BudCom,
                      budrevcom, BudOldAdj
FROM         dbo.tblBudget
0
Comment
Question by:aaronkempf
[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
  • 5
  • 3
10 Comments
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7112383
Where BUDCSI Like '%[0-9]%'

Anthony
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7112386
Or
Where IsNumeric(cplname) = 1

However this assumes the whole string is numeric.

Anthony
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7112387
Typo.  I was testing with some local data, it should have been:
Where IsNumeric(BUDCSI) = 1

Anthony
0
Free Webinar: AWS Backup & DR

Join our upcoming webinar with experts from AWS, CloudBerry Lab, and the Town of Edgartown IT to discuss best practices for simplifying online backup management and cutting costs.

 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 7112393
Also, when you get a chance please maintain your open questions:
Home Network Date: 04/08/2002 12:02PM PST  
http://www.experts-exchange.com/jsp/qShow.jsp?ta=winnt&qid=20286168
Edit Link Bar Date: 04/10/2002 05:42PM PST
http://www.experts-exchange.com/jsp/qShow.jsp?ta=frontpage&qid=20287240

Thanks,
Anthony
0
 
LVL 1

Author Comment

by:aaronkempf
ID: 7112819
can i try this:

Where BUDCSI Like '%[0-9]%'

but instead do this:

Where BUDCSI NOT Like '%[a-z]%'
0
 
LVL 1

Author Comment

by:aaronkempf
ID: 7112822
sorry; i meant to say that this:
Where BUDCSI Like '%[0-9]%'

doesnt' suit my needs; because i have combined text & numeric there.

i need to look for the presence of text & or other characters; and i want to do it in a flexible, maintainable way.



0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 59 total points
ID: 7113818
Is this what you want:

Where BUDCSI Like '%[^0-9]%'

This will check for any characters NOT in the range 0-9 and is basically equivalent to:

Where IsNumeric(BUDCSI) = 0

Anthony
0
 
LVL 1

Author Comment

by:aaronkempf
ID: 7114329
ok lemme try that one--

also, i think that i am getting favorable results with IsNumeric-- ill have to look into it.. brb
0
 

Expert Comment

by:CleanupPing
ID: 9280225
aaronkempf:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Linked Server - SP with Param to VIew 7 25
sql query 5 44
SQL - Error "The Multi-Part Identifier could not be found" 2 21
SQL 2012 Instance Problem 3 62
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

730 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