I spoke too soon. Here's my full code:
UPDATE [tbl 2 JobBCAdd] SET AddVisit1 = Iif([AddVisit1] Is Null,"0"),
AddVisit2 = Iif([AddVisit2] Is Null,"0"), AddVisit3 = Iif([AddVisit3] Is
Null,"0"), AddVisit4 = Iif([AddVisit4] Is Null,"0"), AddVisit5 =
Iif([AddVisit5] Is Null,"0"), AddVisit6 = Iif([AddVisit6] Is Null,"0"),
AddVisit7 = Iif([AddVisit7] Is Null,"0"), AddVisit8 = Iif([AddVisit8] Is
Null,"0"), AddVisit9 = Iif([AddVisit9] Is Null,"0"), AddVisit10 =
Iif([AddVisit10] Is Null,"0"), AddVisit11 = Iif([AddVisit11] Is Null,"0"),
AddVisit12 = Iif([AddVisit12] Is Null,"0"), AddVisit13 = Iif([AddVisit13] Is
Null,"0"), AddVisit14 = Iif([AddVisit14] Is Null,"0"), AddVisit15 =
Iif([AddVisit15] Is Null,"0");
What happens: Nulls become zeroes; valid data replace with null. Ideas?
If this is too convoluted, I'll just do a query for each field. Won't take
that long.
Thanks.
--
Thanks for your help,
Chris
"Allen Browne" wrote:
> Perhaps you could update the field to itself if it is not null:
> UPDATE Table1
> SET Field1 = IIf([Field1] Is Null, "0", [Field1]), ...
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Chris" <(E-Mail Removed)> wrote in message
> news:EC352A9D-03CD-4A4E-BAB9-(E-Mail Removed)...
> >I am updating one table (one time only) having 15 of the fields change from
> > null to 0. Text fields. Yes, I mean to do this. When my query updates
> > one
> > field at a time, it updates fine.
> >
> > I cannot get it to work if I ask it to update all 15 in the one query --
> > field1, field2, field3...etc. Each is set to update to "0" (w/quotes) and
> > the criteria is "Is Null", all criteria on same line (I also tried 'or').
> >
> > Am I going to have to enter 15 queries? I have 3 tables needing this
> > updating with as many fields to update. I use Version 2007.
>
>