Thanks again but I am not an expert on Access. I create queries by
design
Understood. However, I'm not an expert on Access either, which is why I tend
to use the SQL view
So in this case you could try creating a new query (just so you don't screw
up your existing one) and pasting the following SQL
SELECT iif([Table 1].Title = '',
iif([Table 1].Initial='','',[Table 1].Initial + ' '),[Table 1].Title + ' ' +
iif([Table 1].Initial='','',[Table 1].Initial + ' ')) + [Table 1].Last_name
AS `Full_name`,
[Table 1].Title, [Table 1].Initial, [Table 1].Last_name,
[Table 1].Address1, [Table 1].Address2, [Table 1].Town,
[Table 1].County, [Table 1].Postcode
FROM [Table 1]
WHERE ((([Table 1].[Send card])=Yes))
ORDER BY [Table 1].Last_name;
There is no significance in the layout (i.e. location of the line breaks) in
the text - it can all be on one line, as long as the strings with a single
blank (' ') appear correctly in your query text.
I've used the name "Initial" above, whereas your sample text shows "Intial",
which could be a typo - if not, just change all my "Initial" s to "Intial" s
If that query works, for future reference you should be able to switch to
Access's graphical query definition view and see how it would expect you to
define the function in that view.
--
Peter Jamieson
MS Word MVP
hkbs said:
Thanks again but I am not an expert on Access. I create queries by
design
or
wizard. I have just had a look at View | SQL. At present it shows:
SELECT [Table 1].Title, [Table 1].Intial, [Table 1].Last_name, [Table
1].Address1, [Table 1].Address2, [Table 1].Town, [Table 1].County, [Table
1].Postcode
FROM [Table 1]
WHERE ((([Table 1].[Send card])=Yes))
ORDER BY [Table 1].Last_name;
What exactly do I need to paste in? Or can I enter something in Design view?
I have some contacts with no Title and/or no Initial. I know how to put "is
(or is not)
null" in either of these fields but not how to enter either/or to cover
both fields.
Not sure if I am explaining this very well!
hkbs