Hi Everyone!
I am designing a database for my own business and have made a copy of it as a template (to start again without my practice data) and now my query doesn't work.
The query (qryClientsExtended) concatenates the first and last names of clients for printing, searching etc. But allowing either the first or last name to be null.
The SQL (I found via tutorial):
SELECT IIf(IsNull([LastName]),IIf(IsNull([FirstName]),[FirstName]),IIf(IsNull([FirstName]),[LastName],[FirstName] & " " & [LastName])) AS [Client Name], tblClient.*
FROM tblClient
It worked fine on my old database. Like:
Sorry I cant get these illustrations right! But on the second time the [Client Name] field was blank for John (the one with only a first name.
[Client Name] [First] Last
Ben Mead Ben Mead
John John
Clark Clark
But now it will not work for contacts with only first names:
[Client Name] [First] Last
Ben Mead Ben Mead
John
Clark Clark
If anyone knows whats gone wrong here, I'd much appreciate some help. (this is my first post), and i'm pulling my hair out about it.
Thank you ever so much.
Pete
I am designing a database for my own business and have made a copy of it as a template (to start again without my practice data) and now my query doesn't work.
The query (qryClientsExtended) concatenates the first and last names of clients for printing, searching etc. But allowing either the first or last name to be null.
The SQL (I found via tutorial):
SELECT IIf(IsNull([LastName]),IIf(IsNull([FirstName]),[FirstName]),IIf(IsNull([FirstName]),[LastName],[FirstName] & " " & [LastName])) AS [Client Name], tblClient.*
FROM tblClient
It worked fine on my old database. Like:
Sorry I cant get these illustrations right! But on the second time the [Client Name] field was blank for John (the one with only a first name.
[Client Name] [First] Last
Ben Mead Ben Mead
John John
Clark Clark
But now it will not work for contacts with only first names:
[Client Name] [First] Last
Ben Mead Ben Mead
John
Clark Clark
If anyone knows whats gone wrong here, I'd much appreciate some help. (this is my first post), and i'm pulling my hair out about it.
Thank you ever so much.
Pete
Last edited: