# Consultas simples.
## Ejemplo de consulta simple.

***Nombre:*** Lista de ventas en un rango de fecha.

***Consulta SQL:***
```sql
    Select 
        v.referencia,
        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 
    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.***
 - *ShowSummary:* True
 - *SummaryRowHtmlAttributes:*
    - *Attribute:* class
    - *Value:* fw-bold

***Columnas y atributos de la Vista de resultados.***
- referencia. 
    - *Caption:* Referencia.
    - *Field:* referencia
    - *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:***

<img src="https://docs.induxsoft.net/es/productos/v12/tools/querymanager/img/qry-consulta-simple.png">
