ERRO EM COMANDO SQL

INERSELF 12/07/2004 09:54:29
#33153
Bom dia!!!!!

Meu seguinte comando:
"select sum(qtdnf) as qtdtt, npi from tpiEntrega where npi = (select npedido from tpi where mesref between " & MSKmes.Text & " and " & MSKmesr.Text & " and codigocli = '" & cmbcliente.ItemData(cmbcliente.ListIndex) & "') group by npi"

retorna uma mensagem de erro:
"No máximo um registro pode ser retornado por esta subconsulta"

Se alguem souber o que pode ser me de um toque!!!

Desde de já obrigado.....[S20]
LCSD 12/07/2004 11:36:01
#33175
Resposta escolhida
Tente assim, e veja se dá certo:

select sum(qtdnf) as qtdtt, npi from tpiEntrega where npi = (select npedido from tpi where mesref between " & MSKmes.Text & " and " & MSKmesr.Text & " and codigocli = '" & cmbcliente.ItemData(cmbcliente.ListIndex) & "') group by npi, sum(qtdnf)
Tópico encerrado , respostas não são mais permitidas