I m in need of deep help please, how can i group this select by the field
cc.contac_nombre:
Thanks in advance, George.
select
r.recla_nume,
r.clien_base,
c.social_razon,
cc.contac_nombre,
d.depar_descri,
e.even_descrip,
edi.item_descrip
from reclamos r, departamentos d, clientes c, clien_contac cc,
even_depar_item edi, eventos e
where datediff(dd,r.alta_fecha,getdate()) <> 0
and not exists(select * from recla_holds H
where h.recla_nume = r.recla_nume
and h.hold_tipo = 'puntual')
and ( ( r.ulti_esta_codi not in ('C','T','OD','OT','PE')
and datediff(dd,dateadd(dd,r.ciclo, r.ulti_recla_fecha),getdate())
>= 0
and convert(int,datediff(dd,r.alta_fecha,getdate()) / r.ciclo) >
r.envi_canti
)
or r.ulti_esta_codi in ('PE', 'A','AU')
)
and (r.clien_base = c.clien_base)
and (r.clien_base = cc.clien_base and r.contac_codi = cc.contac_codi)
and (r.depar_codi = d.depar_codi)
and (r.even_codi = e.even_codi)
and (r.depar_codi = edi.depar_codi and r.even_codi = edi.even_codi and
r.item_codi = edi.item_codi)
---
You are currently subscribed to sql_language as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-sql_language-$subst('Recip.MemberIDChar')@p2p.wrox.com