Hi Everyone,
I am learning how to use access 2007 and am making a small book database for this purpose.
In my table "books" there is a lookup for the "author" field, which import the data from another table (the "authors" table).
This lookup displays the value from 3 different fields: last name, middle name and first name, divided by a space.
Here is the lookup:
The issue is, when there is no middle name (middle name field is null/blank), the last name and first name are separated by 2 spaces instead of one.
Does anyone know how I can set it so that the two fields are only separated by one space when there is no middle name?
Many thanks,
I am learning how to use access 2007 and am making a small book database for this purpose.
In my table "books" there is a lookup for the "author" field, which import the data from another table (the "authors" table).
This lookup displays the value from 3 different fields: last name, middle name and first name, divided by a space.
Here is the lookup:
Code:
SELECT [authors].[ID], [authors].[last name] & " " & [authors].[middle name] & " " & [authors].[first name] FROM authors ORDER BY [last name], [middle name], [first name];
The issue is, when there is no middle name (middle name field is null/blank), the last name and first name are separated by 2 spaces instead of one.
Does anyone know how I can set it so that the two fields are only separated by one space when there is no middle name?
Many thanks,
Last edited: