Show 0 instead of Null

Joined
Apr 20, 2010
Messages
2
Reaction score
0
Hi All,

I know this is a common question, but after looking high and low on the internet and these forums, i can't find a full answer to my problem.

Firstly, is there a way to query a table of data, and show the value 0 instead of null.

As an example, let's say i have the Name table:

Name | Gender
Harry | Male
Sally |

If i build a query which shows these two colums, can i bring back the data so it looks like this:

Name | Gender
Harry | Male
Sally | 0

Secondly, if i have an outer join from the Name Table to FavouriteHobby Table, is there a way to bring back 0 instead of null where the join doesn't match for that record?

If i use the above table as an example, let's say FavouriteHobby table looks like this:

Name | Hobby
Harry | Basketball

If the name column from both tables is the join, and the outter join is show all records from Name table, and those that match in FavouriteHobby table, the query result would look like:

Name | Gender | Hobby
Harry | Male | Basketball
Sally | Null | Null.

Is there a way to change the null to 0, where the record is not found in the joined table?

Pretty complicated to explain, but i hope the tables help.

A final note, i'm building the query in the design view rather than SQL, as i'm more comfortable with the design view.

Many thanks in advance.

Rac.
 
Joined
Apr 20, 2010
Messages
2
Reaction score
0
I just figured my first question out myself.

I went with nz(fieldname,0), and that worked a treat.

Any help with the second part of my question would be much appreciated.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top