Help with Identifying a character within a field

Neil07979

Registered User.
Local time
Today, 09:50
Joined
Jul 16, 2007
Messages
25
Hi,

I am trying to replicate the find function that is commonly used within Excel.

I have a table that contains reference numbers .. eg:

S4589-uzef
f45565994-ajfhg
F12-546iuhf

I want to create a query that will give me the left most characters up until the "-" that is contained within each reference number. Resulting in :

S4589
f45565994
F12

Any help is welcome!

Thanks
 
Hi -

The InStr() function should do it for you, e.g.

Code:
x = "f45565994-ajfhg"
? left(x, instr(x, "-")-1)
f45565994

HTH - Bob
 

Users who are viewing this thread

Back
Top Bottom