PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 2024
→
DESDE FOX A WINDEV - CONSULTAS SQL SERVER Y CURSORES
DESDE FOX A WINDEV - CONSULTAS SQL SERVER Y CURSORES
Started by CARLOS, Apr., 02 2023 1:14 AM - No answer
Connect yourself…
CARLOS
#1
Posted on April, 02 2023 - 1:14 AM
Hola.
En Visual Fox hago lo siguiente:
*** ME CONECTO A MI BASE SQL SERVER Y OBTENGO LAS VENTAS DE ESTE AÑO EN <CURSOR_VENTAS>
sqlexec(xconec,"select vendedor,cliente,fecha,comprobante,total from ventas where year(fecha)=2023","cursor_ventas")
*** DE <CURSOR_VENTAS> OBTENGO UN RESULTADO POR VENDEDOR EN <CURSOR_VENTAS_VENDEDORES>
select vendedor,sum(total) as total from cursor_documentos group by vendedor into cursor cursor_ventas_vendedores
*** DE <CURSOR_VENTAS> OBTENGO UN RESULTADO POR CLIENTE EN CURSOR_VENTAS_CLIENTES
select cliente,sum(total) as total from cursor_ventas group by cliente into cursor cursor_ventas_clientes
*** DE <CURSOR_VENTAS_CLIENTES> OBTENGO UN RESULTADO EN <CURSOR_TOTAL>
select sum(total) as total from cursor_ventas_clientes into cursor cursor_total
Todo esto lo logro conectándome una sola vez a la base de datos y haciendo una sola consulta.
En Windev 25 obtengo los mismos datos en CURSOR_VENTAS pero a partir de esta consulta quiero hacer otras sin necesidad de ir de nuevo a la data de SQL
¿Se puede en Windev o debo ir a la data?
Gracias adelantadas por su atencion y/o respuesta.
Report
0
0
→ Go back to WINDEV 2024
WINDEV 2024
WEBDEV 2024
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text