# Consultas con agrupaciones.
**Ejemplo de consulta con agrupaciones.**
***Nombre:*** Lista de ventas en un rango de fecha agrupadas por clientes.
***Consulta (UDQ):***
select v.referencia,cd.const as documento,d.codigo as divisa,c.nombre as cliente,v.fecha,v.subtotal,(v.impuesto1+v.impuesto2+v.impuesto3+v.impuesto4) as impuestos,v.subtotal+(v.impuesto1+v.impuesto2+v.impuesto3+v.impuesto4) as total from venta v inner join cliente c on v.icliente=c.sys_pk inner join cdocumentos cd on v.documento=cd.id inner join divisa d on v.idivisa=d.sys_pk where v.statusadministrativo=3 and documento IN (3,4,6) and (v.fecha>=@finicial and v.fecha<=@ffinal);
***ParĂ¡metros y atributos.***
- ffinial:
- *Caption:* Fecha Inicial.
- *Format:* yyyy-MM-dd
- *HtmlAttributes:*
- *Attribute:* class
- *Value:* col-lg-2
- *Id:* finicial
- *Name:* finicial
- *Required:* True
- *Type:* Date
- *Value:* 01/01/2025
- ffinal:
- *Caption:* Fecha final.
- *Format:* yyyy-MM-dd
- *HtmlAttributes:*
- *Attribute:* class
- *Value:* col-lg-2
- *Id:* ffinal
- *Name:* ffinal
- *Required:* True
- *Type:* Date
- *Value:* 20/01/2025
***Vista de resultados.***
***Popiedades de la Vista de resultados.***
- *Agrupar:* cliente
- *ShowSummary:* True
- *ShowSummaryGroup:* True
- *SummaryGroupRowHtmlAttributes:*
- *Attribute:* class
- *Value:* fw-bold
- *SummaryRowHtmlAttributes:*
- *Attribute:* class
- *Value:* fw-bold
***Columnas y atributos de la Vista de resultados.***
- referencia.
- *Caption:* Referencia.
- *Field:* referencia
- *Visible:* True
- documento.
- *Caption:* Documento.
- *Field:* documento
- *Visible:* True
- divisa.
- *Caption:* Divisa.
- *Field:* divisa
- *Visible:* True
- cliente.
- *Caption:* Cliente.
- *Field:* cliente
- *Visible:* True
- fecha.
- *Caption:* Fecha.
- *Field:* fecha
- *Visible:* True
- subtotal.
- *Caption:* Subtotal.
- *Field:* subtotal
- *Format:* $ #,#.00
- *HtmlAttributes:*
- *Attribute:* class
- *Value:* text-end
- *summary:* Sum
- *Visible:* True
- impuestos.
- *Caption:* Impuestos.
- *Field:* impuestos
- *Format:* $ #,#.00
- *HtmlAttributes:*
- *Attribute:* class
- *Value:* text-end
- *summary:* Sum
- *Visible:* True
- total.
- *Caption:* Total
- *Field:* total
- *Format:* $ #,#.00
- *HtmlAttributes:*
- *Attribute:* class
- *Value:* text-end
- *summary:* Sum
- *Visible:* True
***Img ejemplo:***
