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';
 

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

Back
Top