Replace blank field by a zero

le888

Registered User.
Local time
Today, 15:33
Joined
Dec 10, 2003
Messages
344
Hi,

Is it possible to put a zero in a blank field? I have build a query which count records and some off them are zero but the field shows-up blank so, is it possible to replace this blank by a zero?

Thanks,

Le
 
This is the SQL Update Code...

Use Following SQL Update code to replace blank with zero.

Replace tblMain to your table
Replace Field1 to your field


UPDATE tblMain SET tblMain.Field1 = "0"
WHERE (((tblMain.Field1) Is Null));

Good Luck
 
Why don't you set the default value of the field to 0 in the table?
 
Mile-O-Phile said:
Why don't you set the default value of the field to 0 in the table?

No, for example company1 has 3 telephone numbers, company2 has 4 telephone numbers and company3 has zero telephone number. So, what I did, I build-up a query to count the telephone number filed which means company1 = 3, etc. But in Company3 = 0, the field is blank.

Thanks,

Le
 
You obviously need a contacts table for storing multiple contact numbers. This would also be easier to count it.
 
Mile-O-Phile said:
You obviously need a contacts table for storing multiple contact numbers. This would also be easier to count it.
Yet, but when I count it, if is null it appear blank, so, this blank area can be replace by a zero?

Le
 
Rich said:
Nz([YourField],0)
Thanks for your response, but the record which is zero, it doesn't appear anymore. Any ideas?


Le
 
le888 said:
Thanks for your response, but the record which is zero, it doesn't appear anymore. Any ideas?


Le

I have the same problem. have a look at my thread in my signature.
 
le888 said:
Yet, but when I count it, if is null it appear blank, so, this blank area can be replace by a zero?

If done properly you wouldn't have an blank records with Null values making it a moot point.
 
Mile-O-Phile said:
If done properly you wouldn't have an blank records with Null values making it a moot point.

Mile, could you educate us as to what "properly" is then?
 

Users who are viewing this thread

Back
Top Bottom