Concantenation and Null Values (1 Viewer)

Marbinski

Registered User.
Local time
Today, 13:50
Joined
Aug 24, 2004
Messages
45
I have a report where I want to place parentheses around a field in my query.

I have used concantenation w/ the & and got it working fine. But, my problem comes where the value of the field is null. On the report intead of having my field value w/ parentheses I just have the parentheses.

Example of Report(w/ value):

Marvin (Access Programmer)

Example of Report (w/ null value):


Marvin ()

Basically, I'm just looking for some query code that only shows the parentheses if the value is not null. Otherwise I just want the field blank w/out the added concantenated characters.

Here is my original code:
QUERY VALUE: '(' & [TABLENAME]![FIELDNAME] & ')'


Please help....thanks in advance.
 

Jon K

Registered User.
Local time
Today, 21:50
Joined
May 22, 2002
Messages
2,209
Since Null + anything is Null, you can use + instead of &.

.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 16:50
Joined
Feb 19, 2002
Messages
43,392
As Jon said, the + will solve the problem. I suggest that you read about + and & in help. The entries are truely enlightening.
 

Marbinski

Registered User.
Local time
Today, 13:50
Joined
Aug 24, 2004
Messages
45
Thanks a lot, works fine. This is a great tip for me to use later....
 

Users who are viewing this thread

Top Bottom