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 > this is new to me

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-31-02, 05:01
rimian rimian is offline
Registered User
 
Join Date: May 2002
Location: Australia
Posts: 26
Talking this is new to me

Hello!

This is new to me so please excuse my ignorance.

I have a field of comma delimited digits and i want to find out if a digit exists in the string.

eg
1,5,10,20,38

how can i query this so it will make a recordset if i search for "1" but wont for feilds containing "10" or "21".

I hope this makes sense.

Thanks!
__________________
Web Developer
Reply With Quote
  #2 (permalink)  
Old 05-31-02, 05:20
alligatorsql.com alligatorsql.com is offline
Registered User
 
Join Date: Jul 2001
Location: Germany
Posts: 189
Hello,

which database do you use ? This would be very helpful

If you only want to find a comma in a string use

for ORACLE => SELECT INSTR('10,20,30,40', ',')

if the comma is found it returns the position otherwise it return 0

Hope that helps ?

Regards
Manfred Peter
(Alligator Company)
http://www.alligatorsql.com
Reply With Quote
  #3 (permalink)  
Old 06-01-02, 00:26
rimian rimian is offline
Registered User
 
Join Date: May 2002
Location: Australia
Posts: 26
this is microsoft access. soon i will be developing in MySQL.

I know VBscript well enough. but i'm testing for the number not the comma. and Instr() would return a value greater than zero for too many results.

perhaps i just filter them out.

thanks for your help
__________________
Web Developer
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