Getting rid of commas from null field

G

Guest

I have the following expression in a query of a joined table.
([LastName]) & ", " & Left([FirstName],1) AS Expr1
Some of the results are null and the result is a comma by itself. When the
comma is by itself I want to get rid of the comma.

Thank you
 
G

Guest

Try something like:

iif(isnull([LastName]) & ", " & Left([FirstName],1);"";[LastName] & ", " &
Left[FirstName],1)

hth
 
G

Guest

Try

([LastName]) & ", " + Left([FirstName],1) AS Expr1

That way Null + "," will return Null
 
G

Guest

Thank you, this worked GREAT!

Ofer Cohen said:
Try

([LastName]) & ", " + Left([FirstName],1) AS Expr1

That way Null + "," will return Null

--
Good Luck
BS"D


swansonray said:
I have the following expression in a query of a joined table.
([LastName]) & ", " & Left([FirstName],1) AS Expr1
Some of the results are null and the result is a comma by itself. When the
comma is by itself I want to get rid of the comma.

Thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top