Uso el comando dbpExecSQL - Forum

Forum Navigation
You need to log in to create posts and topics.

Uso el comando dbpExecSQL

Buenas tardes, quisiera saber como usar el comando dbpExecSQL, saber donde guarda la consulta y si alguien lo ha usado para generar la suma de los valores de un campo ordenados por fecha. Gracias por su ayuda.

@fernando-alcocer

I would like to know how to use the dbpExecSQL command

dbpExecSQL is a command within the NeoDBPro plugin ... so you will need to install this plugin first.

know where it saves the query

Take a look at the help file ... https://neodbprohelp.visualneo.com/AdvancedSQL.html#dbpExecSQL

and if someone has used it to generate the sum of the values of a field sorted by date.

Please provide details like ...

  • the database you are using (MS Access, mySQL etc.) ... SQL commands can vary depending on the product
  •  databaseID
  • name of fields (values, date)
FERNANDO ALCOCER has reacted to this post.
FERNANDO ALCOCER
Thank you very much for your answer this what I want to do.

Database: service
Table: ticket
Fields: date,sale

I need to add the "sales" of the whole day.

thak you again

@fernando-alcocer

Database: service
Table: ticket
Fields: date,sale

I need to add the "sales" of the whole day.

1) You did not specify what database you were using (I am assuming the suggested command is supported by your Database)

2) Generally not a good idea to name fields that might conflict with "reserved words" ... might want to rename date to salesDate

I did a Google Search with this phrase ... sql to add sales by date ... this is the recommended SQL command ...

SELECT date, SUM(sale) AS "Sales For Date"
FROM ticket
GROUP BY date;

So, your VisualNEOWin might look like ...

dbpExecSQL "service" "SELECT date, SUM(sale) AS "Sales For Date" FROM ticket GROUP BY date" "Temp1"
dbpOpenTable "service" "Temp1" ""
dbpShowGrid "service" "Temp1" "Rectangle1"

Please pay special attention to upper/lower case for database, table and field names.

Vadim has reacted to this post.
Vadim