Re: Nz Problem in ADO execute



Thanks for the prompt reply.

I have done all sorts of testing, and I believe there is a problem with
the way in which Nz is interpreted.
As an example if I do:
strSQL = "UPDATE EZI_SCHEDULE " _
& "SET ESC_FINANCED_AMOUNT = Nz(ESC_FINANCED_AMOUNT,60)
" _
& "WHERE ESC_SCHEDULE_ID = '" & strSCH & "';"
The code (and Nz) works as expected, but as soon as I introduce a
mathematical function (see below) the Nz(ESC_FINANCED_AMOUNT,60) always
evaluates to 0:
strSQL = "UPDATE EZI_SCHEDULE " _
& "SET ESC_FINANCED_AMOUNT = Nz(ESC_FINANCED_AMOUNT,60)
+15 " _
& "WHERE ESC_SCHEDULE_ID = '" & strSCH & "';"

Likewise if I use Docmd.runsql instead of cnn.execute, teh code works
correctly.
I cannot find any other explanation, other than an error in the way Nz
is treated by ADO.

Regards
Steve

.