Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query using =iif(isnull plus a comma and 1

Status
Not open for further replies.

Tiggertoo

MIS
May 28, 2003
66
0
0
US
This is what I have
IT: ([ITOwn1] & ", " & [itown2] & ", " & [itown3])
Unfortunately if a field is null you end up with a comma or two ,,Joe Smith

I'm hoping to write something like
IT:=iif(isnull(([itown1]),"",([itown1]&", ")(isnull(([itown2]),"",([itown2]&", ") etc

In other words if itown1 is null then print nothing else print itown1, (that's with a comma) and then continue on with if itown2 is null then print nothing else print itown2,

Ending up with John Smith, Joe Doe, Joe Smith instead of
,,Joe Smith.

Hope I've made sense...

Or is there an easier way to accomplish this... remember I don't speak VB
 
IT: ([ITOwn1] + ", " & [itown2] + ", " & [itown3])

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks,
Just exactly what I was looking for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top