Solved

IS NUMBER

Posted on 2002-06-26
10
232 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
  • 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

743 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

12 Experts available now in Live!

Get 1:1 Help Now