Show blank values as 0 (zero)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

could someone please help, is there a way of showing a zero in a query field
that shows a blank (empty) field.
 
Assuming that the blank field is actually a Null value, you can use the Nz
function.

Instead of SELECT MyField ... FROM MyTable, try SELECT Nz([MyField], 0) AS
Field FROM MyTable
 
You can format the query field to show a zero for nulls (blank)
In design view in the format property of the colummn type
0;-0;0;0

Or you can use a calculated field to return zero.

Field: NyFieldWithZeros: NZ([MyTable].[Myfield],0)

Be aware that the two will behave differently if you are using them in a report
or on a form.
 
Thanks for that, seems so easy when you no the answer
Cheers

John Spencer said:
You can format the query field to show a zero for nulls (blank)
In design view in the format property of the colummn type
0;-0;0;0

Or you can use a calculated field to return zero.

Field: NyFieldWithZeros: NZ([MyTable].[Myfield],0)

Be aware that the two will behave differently if you are using them in a report
or on a form.


could someone please help, is there a way of showing a zero in a query field
that shows a blank (empty) field.
 
Back
Top