c – MS Access中的NZ功能的ADO等价物?
作者:互联网
我有以下命令对象:
ADODB::_CommandPtr pCmd("ADODB.Command");
pCmd->ActiveConnection = pConn;
pCmd->CommandType = ADODB::adCmdText;
pCmd->CommandText = L" select ID, NZ(PaymentAmount, 0) from Contracts;";
ADODB::_RecordsetPtr pRS = pCmd->Execute(NULL, NULL, ADODB::adCmdText);
当我运行它时,它会报告NZ函数不存在的错误.
我自己研究,发现我不能在ADO查询中使用NZ.
题:
ADO是否等同于此功能?
解决方法:
使用与Nz产生相同结果的IIf表达式.
select ID, IIf(PaymentAmount Is Null, 0, PaymentAmount) As nz_PaymentAmount
from Contracts;
标签:c,sql,ms-access,ms-access-2007,ado 来源: https://codeday.me/bug/20190728/1559738.html