Este SELECT me genera el siguiente error...
Publicado por J@m (79 intervenciones) el 08/08/2011 21:59:16
"SELECT sum(cant_ing) as cantid, cod_mot, ref_prod FROM cont_tras WHERE fec_est >='"&fec_ini&"' and fec_est <='"&fec_fin& "' and (est_tras = 'C' or est_tras = 'I') and usr_est = '"&codbod&"' and cod_empr ="&cod_empr&" group by cod_mot order by cod_mot"
necesito el campo ref_prod, para consultar esa referencia pero el selec me arroja este error:
Microsoft OLE DB Provider for SQL Server error '80040e14'
Column 'cont_tras.ref_prod' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Que puedo hacer para incluir ese campo en el select, gracias.
necesito el campo ref_prod, para consultar esa referencia pero el selec me arroja este error:
Microsoft OLE DB Provider for SQL Server error '80040e14'
Column 'cont_tras.ref_prod' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Que puedo hacer para incluir ese campo en el select, gracias.
Valora esta pregunta


0