Log in

View Full Version : Solved: Replacing numeric field values in multiple fields in multiple tables



jauner
12-07-2005, 12:48 PM
Is there a fairly easy way to loop through the table collections and if a table has a number field to loop through each row and replace with zero if null?

geekgirlau
12-07-2005, 03:26 PM
Technically it could be done, although depending on the number of fields, tables and records it could take a while. You need to have a think about why you are doing this - is it a once-off cleanup exercise? You can set the property of your numeric fields in the table to default to zero, but how are you planning to cope with users deleting the value in a field?

IMHO you are better of coping with nulls in your code and queries etc. rather than updating everything to zero.

jauner
12-08-2005, 09:20 AM
well I ending up just doing a replace in the table. It was a one time cleanup thing. The fields are all drop down list so from that standpoint nulls are all good.