If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Select text values

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-14-03, 10:49
GA_KEN GA_KEN is offline
Registered User
 
Join Date: Jan 2003
Posts: 126
Select text values

Hi all,

I have a column of data that has Account Numbers in it, it should contain all numric numbers.

Is there anyway to select all the rows that have text as the account number? i.e. if the account number is stored as say "abc" then I want to select it.

Thanks,

Ken
Reply With Quote
  #2 (permalink)  
Old 03-14-03, 11:10
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: Select text values

Quote:
Originally posted by GA_KEN
Hi all,

I have a column of data that has Account Numbers in it, it should contain all numric numbers.

Is there anyway to select all the rows that have text as the account number? i.e. if the account number is stored as say "abc" then I want to select it.

Thanks,

Ken
What DBMS? I could tell you how to do it in Oracle, but I suspect you are on something else?
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #3 (permalink)  
Old 03-14-03, 11:11
GA_KEN GA_KEN is offline
Registered User
 
Join Date: Jan 2003
Posts: 126
I guess that would be important!

I'm using SQL2000
Reply With Quote
  #4 (permalink)  
Old 03-14-03, 11:37
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Quote:
Originally posted by GA_KEN
I guess that would be important!

I'm using SQL2000
There is a SQL Server function called ISNUMERIC that looks like it fits the bill.
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
Reply With Quote
  #5 (permalink)  
Old 03-14-03, 12:02
GA_KEN GA_KEN is offline
Registered User
 
Join Date: Jan 2003
Posts: 126
Great!

Thanks for pointing me in the right direction! This works:

Code:
select *   from Accounttbl where ISNUMERIC([account number]) = 0
Thanks again!

Ken
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On