mid or trim function?

TjS

Registered User.
Local time
Today, 21:37
Joined
Jul 18, 2007
Messages
126
a maybe simple question:

With the mid function one can make sure that a part of a text is token to display on a report, output or whatever.

But how to do the following:
"John Isaac"
"William Bill"
"Michael Robert"

In the report the following has to be visible:
"John"
"William"
"Michael"

The use of mid is i think possible, and starting with the first letter as well, but how to determine when the space is coming?

Please advise!
 
Look at "DEmoNameOnlyA2002.mdb
Look at Table1, Query2, Module1.
Run Query2.
 

Attachments

But how to do the following:
"John Isaac"
"William Bill"
"Michael Robert"

In the report the following has to be visible:
"John"
"William"
"Michael"
Use this...
Code:
SELECT left([field], (Instr([field], " ")-1))
but how to determine when the space is coming?
This is a question of controversy, but I always use Instr().
 
problem solved!

SELECT left([field], (Instr([field], " ")-1))

Did the trick.

Unfortunately i couldn't use the 2002 access db; because i have access2000 and of course it wouldn't open the 2002 version...

Thanks to all for the help
 

Users who are viewing this thread

Back
Top Bottom