Hi,
Is it possible to use the Find Keyword in an expression in a query? I've done a search of this forum and couldn't find any specific for that.
I have imported data from an excel spreadsheet which has a field called FullName, which in my table in my database is called strFullname.
I have created an append query to append the data to a new table with only the information I want.
Now what I am trying to do is to obtain only the customers Title and Surname, I've worked out how to get the Title part, the tricky part is obtaining only the Surname part and putting it into a seperate field.
Here is an example of how the data looks:
Mr A Jones
Mrs B A Bolds
Mr Johnson
As I said above I've worked out how to get the salutation part [Title] but I'm having problems working out how to get the Surname aspect. This is my expression I've tried to use, which doesn't work, because Access says it doesn't recognise the Find Keyword.
Surname: IIf(Mid([strFullName]<>"",FIND(" ",[strFullName],0),20),"")
So what I'm trying to do here is if the field strFullName is not equal to nothing then FIND a space and return 20 characters to the right.
so from the above examples I want to only append the following
Jones
Bolds
Johnson
Clearly I'm doing something wrong, so any help would be greatly appreciated.
John
Is it possible to use the Find Keyword in an expression in a query? I've done a search of this forum and couldn't find any specific for that.
I have imported data from an excel spreadsheet which has a field called FullName, which in my table in my database is called strFullname.
I have created an append query to append the data to a new table with only the information I want.
Now what I am trying to do is to obtain only the customers Title and Surname, I've worked out how to get the Title part, the tricky part is obtaining only the Surname part and putting it into a seperate field.
Here is an example of how the data looks:
Mr A Jones
Mrs B A Bolds
Mr Johnson
As I said above I've worked out how to get the salutation part [Title] but I'm having problems working out how to get the Surname aspect. This is my expression I've tried to use, which doesn't work, because Access says it doesn't recognise the Find Keyword.
Surname: IIf(Mid([strFullName]<>"",FIND(" ",[strFullName],0),20),"")
So what I'm trying to do here is if the field strFullName is not equal to nothing then FIND a space and return 20 characters to the right.
so from the above examples I want to only append the following
Jones
Bolds
Johnson
Clearly I'm doing something wrong, so any help would be greatly appreciated.
John