If null

A

AN

I have an unbound box on my report =[ReviewPeriod] & "
months" but if the review period is blank, I don't want it
to print "months". How do I change my expression to handle
that? Thanks for the assistance.
 
A

Allen Browne

Try:
=Str([ReviewPeriod]) + " months"

It is generally better to use the ampersand for concatenation, rather than
plus. However, there is a subtle difference in behaviour:
"Z" & Null => "Z"
"Z" + Null => Null
 
T

tina

try
=IIf([ReviewPeriod] Is Null, Null, IIf([ReviewPeriod] = 1, [ReviewPeriod] &
" month", [ReviewPeriod] & " months"))

hth
 
A

AN

Thanks, that did it.
-----Original Message-----
Try:
=Str([ReviewPeriod]) + " months"

It is generally better to use the ampersand for concatenation, rather than
plus. However, there is a subtle difference in behaviour:
"Z" & Null => "Z"
"Z" + Null => Null

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I have an unbound box on my report =[ReviewPeriod] & "
months" but if the review period is blank, I don't want it
to print "months". How do I change my expression to handle
that? Thanks for the assistance.


.
 
Top