Getting rid of commas from null field

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
Try something like:

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

hth
 
Try

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

That way Null + "," will return Null
 
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
 
Back
Top