View Full Version : query that detects and character


motov600
04-13-2005, 05:04 AM
hello

if got a query which has a field with numbers like "1/7807" and "S095/21"

i need a code that will say iff part table has "/" then 2 if not 1

please can anyone help

it needs to detect the "/"

thanks

regards raj

john471
04-13-2005, 05:19 AM
(you will need to change the "tblYourTableName" and "YourFieldName"(s) to the appropriate names of your table and field.)

SQL:-

SELECT tblYourTableName.YourFieldName, IIf(InStr(1,[YourFieldName],"/",1)>0,2,1) AS Slash
FROM tblYourTableName;

motov600
04-14-2005, 01:28 AM
cheers john

that work like a charm

nice one