Need to fill nulls with zero?

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

Guest

I have the following query which runs fine, but, I need the field [PY_ACTUAL]
in the table being updated to be filled with zeros if a NULL results. Can
someone please correct the SQL below to make that work?

UPDATE [MERGE] INNER JOIN [IMPORT] ON
[MERGE].[ACCTNO] = [IMPORT].[ACCTNO]
SET [MERGE].[PY_ACTUAL] = [IMPORT].[YTD_ACTUAL]
WHERE [IMPORT].[PERIOD_VALUE] = '2';

Thanks much in advance.
 
UPDATE [MERGE] INNER JOIN [IMPORT] ON
[MERGE].[ACCTNO] = [IMPORT].[ACCTNO]
SET [MERGE].[PY_ACTUAL] = Nz([IMPORT].[YTD_ACTUAL],0)
WHERE [IMPORT].[PERIOD_VALUE] = '2';
 
Back
Top