PDA

View Full Version : this is new to me


rimian
05-31-02, 06:01
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!

alligatorsql.com
05-31-02, 06:20
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

rimian
06-01-02, 01: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