Need to display a zero

Oscar_W

Registered User.
Local time
Today, 05:50
Joined
Mar 9, 2006
Messages
42
Hi,
The following control in a report displays the number of people with surnames the same as those who served onboard HMS Victory during the battle of Trafalgar:

Code:
[In VICTORY.CountOfCountOfSurname] & " " & [surname] & " - in VICTORY."

It works fine but if there are no matches, it just displays " Smith - in VICTORY.", how can I make it display "0 Smith - in VICTORY."

Thanks in advance,
Oscar

NB. Actually there were 16 Smiths in case anyone is interested!
 
IIF(IsNull([In VICTORY.CountOfCountOfSurname]),0, & " " & [surname] & " - in VICTORY.")
 
Many thanks for the very speedy response but that is giving me two errors? When I type it into the control box it says that it has an "invalid control source". If I ignore that and try and display the report, I get an error that tells me there are too many ")"
I have tried mucking about with the number of brackets but no joy yet :confused:
 
Sorted it.

Code:
=IIf(IsNull([In VICTORY.CountOfCountOfSurname]),0 & " " & [surname] & " in Victory",([In VICTORY.CountOfCountOfSurname]) & " " & [surname] & " in Victory")

Many thanks for the initial steer.
 

Users who are viewing this thread

Back
Top Bottom