This is my first question.
Im pulling data out of an oracle database with asp.
Im trying to construct an email address on the fly from payroll data. Unfortunately the forename field also contains middle names, so i want to remove all text after the space (chr(32)).
Im using this code which does the job if the field contains a middlename (ie a space), but leaves the field blank if only the first name is entered.
I need it to return the fistname irrespective of whether it contains a middle name.
select substr(per_forename,1,(instr(per_forename,chr(32),1,1)-1))as email from mytable
"julian gregson" returns "julian"
"julian" returns ""
Hope you can help
Thanks in advance.